JOGL Applet Launcher Null pointer exception

I have an applet which uses JOGL and I keep getting this error.

java.lang.NullPointerException
at com.sun.opengl.util.JOGLAppletLauncher.start(JOGLAppletLauncher.java:394)
at sun.applet.AppletPanel.run(AppletPanel.java:418)
at java.lang.Thread.run(Thread.java:595)

My html file is as in the examples…

<html>
<title> Dance Simulation </title>
<body>
<center>
<applet code="com.sun.opengl.util.JOGLAppletLauncher"
     width=900
     height=500
     archive="jogl.jar,gluegen-rt.jar,dancer.jar">
  <param name="subapplet.classname" VALUE="Dancer">
  <param name="subapplet.displayname" VALUE="Dancer Applet">
  <param name="progressbar" value="true">
  <param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,dancer.jar">
  <param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload,dancer.jar;preload">
</applet>

</center>

</body>
</html>

I think I have properly signed jars, but I’m not sure I am creating “dancer.jar” as supposed to be. Can it be the cause of my problem? If this is the case, how should I create the jar?

Can anybody help me in this issue?

What version of JOGL are you using? That stack trace doesn’t correspond to either the current nightly build or the recent 1.1.0-rc3. Have you tried using a more recent build?

To build your jar, use the jar command. For example, if you have the directory and package structure org/mycompany/MyApplet.class, cd to the directory containing the org/ subdirectory and run


jar cvf myapplet.jar org

Another example if your applet is in the unnamed package:


jar cvf dancer.jar Dancer*.class

Under current nightly build, I got this stack trace.


java.lang.NullPointerException
	at com.sun.opengl.util.JOGLAppletLauncher.start(JOGLAppletLauncher.java:404)
	at sun.applet.AppletPanel.run(AppletPanel.java:418)
	at java.lang.Thread.run(Thread.java:595)

What’s in dancer.jar? You didn’t put a copy of the JOGLAppletLauncher in there, did you? Did you otherwise modify jogl.jar (did you erase the manifest)?

Only my classes are in dancer.jar.

I unsigned and resigned all the other jars. (jogl, gluegen…). Shouldn’t I do that?

When I tried unmodified versions of jars, I get this error.


Native library jogl.dll isn't properly signed or has other errors

If you use the jars from one of the promoted builds (1.1.0-rc3 is the latest) and pick up the webstart zip archive, those jars are all properly signed. For applet deployment you don’t need to resign them. For Web Start you can just refer to our extension JNLP file. Only if you redeploy our jars on your web server for Java Web Start do you need to resign jogl.jar.

You need to be very careful when “unsigning” jogl.jar. The META-INF/MANIFEST.MF contains package version information that you’re losing and which is causing the NullPointerException you’re running into.

Thanks Ken, this seems to resolve my problem.

But I cannot find gluegen-rt native jars. Can you provide the link for them?

Nevermind Ken, I found them at http://kyrondevelopment.com/jogl-web/1-1-0/

But I didn’t understand why it is not available at https://gluegen.dev.java.net/

They are there: here