JOGL applet problems in JSF page

I am getting a runtime error deploying a JOGL applet in a ICEfaces/JSF application. The markup for the applet, which is listed below, is the same in the html source as it is in the generated JSP source. Yet, it runs in the html version. A non-JOGL applet will run just fine in either (html or jsp generated).

Suggestions? Perhaps there is a configuration file that needs to be updated? There is very little documentation on applets in JSF/JSP apps.

[quote]Java Plug-in 1.6.0_03
Using JRE version 1.6.0_03 Java HotSpot™ Client VM

JNLPAppletLauncher: static initializer
os.name = linux
nativePrefix = lib nativeSuffix = .so
tmpRootDir = /tmp/jnlp-applet/jln30691
Applet.init
subapplet.classname = DemoApplet
subapplet.displayname = OpinionMap
Applet.start
os.name = linux
os.arch = i386
processNativeJar: using previously cached: /home/rogene/.jnlp-applet/cache/localhost_8080/71df4eda7b653fcf498962bb42a738cc8d225078/gluegen-rt-natives-linux-i586.jar
validateCertificates:
VALIDATE: libgluegen-rt.so
extractNativeLibs:
EXTRACT: libgluegen-rt.so(gluegen-rt)
processNativeJar: using previously cached: /home/rogene/.jnlp-applet/cache/localhost_8080/71df4eda7b653fcf498962bb42a738cc8d225078/jogl-natives-linux-i586.jar
validateCertificates:
VALIDATE: libjogl.so
VALIDATE: libjogl_awt.so
VALIDATE: libjogl_cg.so
extractNativeLibs:
EXTRACT: libjogl.so(jogl)
EXTRACT: libjogl_awt.so(jogl_awt)
EXTRACT: libjogl_cg.so(jogl_cg)
Exception in thread “AWT-EventQueue-2” java.lang.NoClassDefFoundError: javax/media/opengl/GLCanvas
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.jdesktop.applet.util.JNLPAppletLauncher.startSubApplet(JNLPAppletLauncher.java:1889)
at org.jdesktop.applet.util.JNLPAppletLauncher.access$200(JNLPAppletLauncher.java:658)
at org.jdesktop.applet.util.JNLPAppletLauncher$5.run(JNLPAppletLauncher.java:1269)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[/quote]

[								<f:verbatim escape="false">
								<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
									height="400" width="600"
									archive="http://download.java.net/media/applet-launcher/applet-launcher.jar, http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-curre
nt/jogl.jar, http://download.java.net/media/gluegen/webstart/gluegen-rt.jar, DemoApplet.jar, worldwind.jar">
									<param name="codebase_lookup" value="false" />
									<param name="subapplet.classname" value="DemoApplet" />
									<param name="subapplet.displayname" value="OpinionMap" />
									<param name="noddraw.check" value="true" />
									<param name="progressbar" value="true" />
									<param name="jnlpNumExtensions" value="1" />
									<param name="jnlpExtension1"
										value="http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1-rc5/webstart/jogl.jnlp" />
								</applet>
								</f:verbatim>/code]

Double-check everything. The problem is that the JOGL classes aren’t visible to the Java Plug-In. One thing I noticed right off the bat is that you’re missing a codebase parameter, so you need to double-check where your DemoApplet.jar and worldwind.jar live. I also noticed that there are spaces in your archive tag (this shouldn’t matter, but try getting rid of them) and that the jogl.jar you reference in your archive tag isn’t the same as the JNLP file you reference (though in this case they should be close enough that they should work). Save the JSP’s outputted HTML and try viewing that (or cutting it down until you can view it) and see whether it loads properly. Debug it outside the JSP framework and then hook it back in.

Thanks, Ken.

Rather than fussing with the applet tag, I tried replacing that code with a direct cut & paste from the html page that I knew to work. I probably should have done this to begin with, but my starting point was to get the jsp:plugin tag to work (it turns out that it is not supported in ICEfaces), and parameterizing a single tag (applet) seemed like a better idea than trying to debug code below.

What references should I be using for the JNLP and JOGL links? I recall switching the JNLP link in response to a posting at the WorldWind forum about 5-6 weeks ago. What page should I be monitoring in the future to insure that I am always referencing the preferred versions?

Thank you very much for your help and all you have done to bring JOGL into our webapps.

Code that works:

								<f:verbatim escape="false">
									<!--[if !IE]>-->
									<object id="opmapapplet"
										classid="java:org.jdesktop.applet.util.JNLPAppletLauncher"
										type="application/x-java-applet" width="600" height="400"
										archive="http://download.java.net/media/applet-launcher/applet-launcher.jar,http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,http://download.java.net/media/gluegen/webstart/gluegen-rt.jar, DemoApplet.jar, worldwind.jar">
										<param name="archive"
											value="http://download.java.net/media/applet-launcher/applet-launcher.jar,http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,http://download.java.net/media/gluegen/webstart/gluegen-rt.jar, DemoApplet.jar, worldwind.jar" />
										<param name="mayscript" value="true" />
										<param name="codebase_lookup" value="false" />
										<param name="subapplet.classname" value="DemoApplet" />
										<param name="subapplet.displayname" value="OpinionMap" />
										<param name="noddraw.check" value="true" />
										<param name="progressbar" value="true" />
										<param name="jnlpNumExtensions" value="1" />
										<param name="jnlpExtension1"
											value="http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1-rc5/webstart/jogl.jnlp" />
										<!--<![endif]-->
										<object id="opmapapplet"
											classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
											width="600" height="400">
											<param name="code"
												value="org.jdesktop.applet.util.JNLPAppletLauncher" />
											<param name="archive"
												value="http://download.java.net/media/applet-launcher/applet-launcher.jar,http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,DemoApplet.jar,worldwind.jar" />
											<param name="mayscript" value="true" />
											<param name="codebase_lookup" value="false" />
											<param name="subapplet.classname" value="DemoApplet" />
											<param name="subapplet.displayname" value="OpinionMap" />
											<param name="noddraw.check" value="true" />
											<param name="progressbar" value="true" />
											<param name="jnlpNumExtensions" value="1" />
											<param name="jnlpExtension1"
												value="http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1-rc5/webstart/jogl.jnlp" />
										</object>
										<!--[if !IE]>-->
									</object>
									<!--<![endif]-->
								</f:verbatim>

I get it now… I replaced the JNLP link with: http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp

Thanks for pointing that out!