Hey,
I'm trying to set up some Java Applets with JOGL OpenGL. The Applets work fine with the JNLP Applet Launcher or the Java Web Start when I have a connection to the internet. But it is important that these applets work in a local network without access to the internet also. I downloaded all necessary .JAR and .JNLP files (I Think) and put it on a local webserver. When starting an applet/application I get the error "UnknownHostException: jogamp.org". So I ask here for help. Would be glad if you can help me. Thanks a lot Sandhase |
Some more information:
With some research on the topic this afternoon i realized that I did not followed _all_ files. So I downloaded a lot of jar files and ca 6-8 .jnlp files which should be all I need not i hope. All links to the files in the Internet are replaced with the Link on my webserver but it does not work. I get many different errors due to different versions I think. Got some problems with the signing but removed all security tags in the .jlnp files so the problem is solved i guess. For now I get an error saying: java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/media/opengl/GLAnimatorControl at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3063) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1481) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NoClassDefFoundError: javax/media/opengl/GLAnimatorControl at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at sun.plugin2.applet.Plugin2Manager$12.run(Plugin2Manager.java:3005) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLAnimatorControl at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:983) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:939) at sun.plugin2.applet.JNLP2ClassLoader.findClass(JNLP2ClassLoader.java:308) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 14 more Ausnahme: java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/media/opengl/GLAnimatorControl But I#ve checked the jogl.all.jar, changed it and now the GLAnimatorControl Interface is in the jar file but nothing changed. Hope somebody could help me. Last time I forgot the code for the .html and .jnlp file for the applet itself. here it is: HTML File: <applet code="org.jdesktop.applet.util.JNLPAppletLauncher" width=640 height=400 archive="http://x/applets/data/applet-launcher.jar, http://x/applets/data/jogampLib/nativewindow.all.jar, http://x/applets/data/jogampLib/jogl.all.jar, http://x/applets/data/jogampLib/gluegen-rt.jar, http://x/applets/JOGLApplet.jar"> </applet> The .JNLP File: <?xml version="1.0" encoding="utf-8"?> <jnlp href="applet-test.jnlp"> <information> <title>JOGL JNLP Applet Demo</title> <vendor>DLR</vendor> <description>Demo</description> <description kind="short">JOGL DEMO.</description> <offline-allowed/> </information> <resources> <j2se version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="http://x/applets/JOGLApplet.jar" main="true"/> <extension name="newt-all-awt" href="http://x/applets/data/jogampLib/newt-all-awt.jnlp" /> </resources> <applet-desc name="JOGL Applet" main-class="test.TriangleApplet" width="640" height="480"> </applet-desc> </jnlp> where x stands for the ip-address of the webserver.. thanks |
Again the HTML File because it was not correct. I added some points so the complete applet tag is now correct.
<applet code="org.jdesktop.applet.util.JNLPAppletLauncher" width=640 height=400 archive="http://x/applets/data/applet-launcher.jar, http://x/applets/data/jogampLib/nativewindow.all.jar, http://x/applets/data/jogampLib/jogl.all.jar, http://x/applets/data/jogampLib/gluegen-rt.jar, http://x/applets/JOGLApplet.jar"> <pa.ram name="codebase_lookup" value="false"> <par.am name="subapplet.classname" value="test.TriangleApplet"> <par.am name="subapplet.displayname" value="Test JOGL Applet"> <par.am name="noddraw.check" value="true"> <par.am name="progressbar" value="true"> <par.am name="jnlpNumExtensions" value="1"> <par.am name="jnlpExtension1" value="http://x/applets/data/sunLib/jogl-core.jnlp"> <par.am name="java_arguments" value="-Dsun.java2d.noddraw=true"> <par.am name="jnlp_href" value="applet-test.jnlp"> </applet> |
Administrator
|
In reply to this post by Sandhase
Maybe it would help to take one variable out of the equation -- perhaps you could test a "known good" applet like one from http://jogamp.org/jogl-demos/www/ to see if it has the same problem?
|
I've downloaded the jogl-demos.jar and jogl-demo-utils.jar and tried the gears applet.
Did not work either...same error message. again here is the HTML Tag: <applet code="org.jdesktop.applet.util.JNLPAppletLauncher" width=600 height=400 archive="http://x/applets/data/applet-launcher.jar, http://x/applets/data/jogampLib/nativewindow.all.jar, http://x/applets/data/jogampLib/jogl.all.jar, http://x/applets/data/jogampLib/gluegen-rt.jar, http://x/applets/jogl-demos.jar"> < param name="codebase_lookup" value="false"> < param name="subapplet.classname" value="demos.applets.GearsApplet"> < param name="subapplet.displayname" value="JOGL Gears Applet"> < param name="noddraw.check" value="true"> < param name="progressbar" value="true"> < param name="jnlpNumExtensions" value="1"> < param name="jnlpExtension1" value="http://x/applets/data/sunLib/jogl-core.jnlp"> < param name="java_arguments" value="-Dsun.java2d.noddraw=true"> < param name="jnlp_href" value="Gears.jnlp"> </applet> JNLP: <?xml version="1.0" encoding="utf-8"?> <jnlp codebase="http://129.247.81.99/applets/" href="Gears.jnlp"> <information> <title>JOGL Gears Demo</title> <vendor>JogAmp Community</vendor> <homepage href="http://jogamp.org/jogl-demos/"/> <description>Gears Demo</description> <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> <offline-allowed/> </information> <update check="background" policy="always"/> <resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="jogl-demos.jar" main="true"/> <jar href="data/jogampLib/jogl-demos-util.jar" /> <extension name="newt-all-awt" href="http://129.247.81.99/applets/data/jogampLib/newt-all-awt.jnlp" /> </resources> <applet-desc name="Gears-Applet" main-class="demos.applets.GearsApplet" width="640" height="480"> </applet-desc> </jnlp> thanks for your reply Edit: Another question: I've checked my .jnlp files again and now I#m a little bit confused. I got one jogl-core.jnlp with links to the sun site and one with links to this site. Do I need files from the Sun-Site or just files from jogamp.org? This might solve the problem because I've downloaded files from both sites and both got links in the .jnlp files I use |
Administrator
|
Hi Sandhase,
I tested this today, and got a simple Java Web Start app working both with and without network. Here's what I did: 1. Copied gluegen-rt.jar, nativewindow.all.jar, jogl.all.jar, newt.all.jar, jogl.test.jar, ant.jar, ant-junit.jar, junit.jar, and all the JOGL DLLs into one dir. 2. Created a signing key: keytool -genkey -keystore testKeys -alias ww 3. Signed all the JARs with: jarsigner -keystore testKeys ant-junit.jar ww 4. Created GearsTest.jnlp in the same dir as my JARs and DLLs: <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="file://localhost/C:/Documents and Settings/wwalker/My Documents/jogl2/jws/" href="GearsTest.jnlp"> <information> <title>JOGL Gears Demo</title> <vendor>JogAmp Community</vendor> <homepage href="http://jogamp.org/jogl-demos/"/> <description>Gears Demo</description> <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> <offline-allowed/> </information> <update check="background" policy="always"/> <security> <all-permissions/> </security> <resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="jogl.test.jar" main="true"/> <jar href="gluegen-rt.jar" /> <jar href="nativewindow.all.jar" /> <jar href="jogl.all.jar" /> <jar href="newt.all.jar" /> <jar href="ant.jar" /> <jar href="ant-junit.jar" /> <jar href="junit.jar" /> </resources> <application-desc main-class="com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT"> </application-desc> </jnlp> 5. Ran by double-clicking GearsTest.jnlp from Windows explorer. 6. Unplugged the network cable, ran it again, still works! |
there are no natives specified in your jnlp and i also see no jnlp extension pointing to an another jnlp. Have you jogl natives in your system path? a jnlp handling native libs would look like this one: http://jogamp.org/deployment/webstart-next/gluegen-rt.jnlp sidenote: you should not need the ant and junit jars. regards, michael On 01/19/2011 06:08 PM, Wade Walker [via jogamp] wrote: Hi Sandhase, -- http://michael-bien.com/ |
In reply to this post by Wade Walker
ups. sorry responded to quickly. I somehow missed the last part of
point 4). (The 'codebase' is in the searchpath for native libs - all good :) ) however you will have to use the 'nativelib' tags at the end of the day, since you can't place all native libs in one folder because of naming conflicts between 32 and 64bit libs. -michael On 01/19/2011 06:08 PM, Wade Walker [via jogamp] wrote: > Hi Sandhase, > > I tested this today, and got a simple Java Web Start app working both > with and without network. Here's what I did: > > 1. Copied gluegen-rt.jar, nativewindow.all.jar, jogl.all.jar, > newt.all.jar, jogl.test.jar, ant.jar, ant-junit.jar, junit.jar, and > all the JOGL DLLs into one dir. > 2. Created a signing key: keytool -genkey -keystore testKeys -alias ww > 3. Signed all the JARs with: jarsigner -keystore testKeys > ant-junit.jar ww > 4. Created GearsTest.jnlp in the same dir as my JARs and DLLs: > > <?xml version="1.0" encoding="utf-8"?> > <jnlp spec="1.0+" codebase="file://localhost/C:/Documents and Settings/wwalker/My Documents/jogl2/jws/" > href="GearsTest.jnlp"> > > <information> > <title>JOGL Gears Demo</title> > <vendor>JogAmp Community</vendor> > <homepage href="http://jogamp.org/jogl-demos/"/> > <description>Gears Demo</description> > <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> > <offline-allowed/> > </information> > <update check="background" policy="always"/> > > <security> > <all-permissions/> > </security> > > <resources> > <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> > <property name="sun.java2d.noddraw" value="true"/> > <jar href="jogl.test.jar" main="true"/> > <jar href="gluegen-rt.jar" /> > <jar href="nativewindow.all.jar" /> > <jar href="jogl.all.jar" /> > <jar href="newt.all.jar" /> > <jar href="ant.jar" /> > <jar href="ant-junit.jar" /> > <jar href="junit.jar" /> > </resources> > > <application-desc main-class="com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT"> > </application-desc> > </jnlp> > > > 5. Ran by double-clicking GearsTest.jnlp from Windows explorer. > 6. Unplugged the network cable, ran it again, still works! > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://jogamp.762907.n3.nabble.com/JOGL-Web-Start-Applet-in-a-Local-Net-tp2278856p2288671.html > > To start a new topic under jogamp, email > ml-node+762907-380265080-8131@n3.nabble.com > To unsubscribe from jogamp, click here > <http://jogamp.762907.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=762907&code=YmllbmF0b3JAYXJjb3IuZGV8NzYyOTA3fDQxNTEwMDY0OA==>. > -- http://michael-bien.com/ |
Administrator
|
Hi Michael,
I agree, the nativelibs tag is the right thing to do -- that previous post was my first JNLP file ever I was just trying to show Sandhase how to do a quick and dirty test in a single directory, without using any of his own JARs or setting up a web server. And I was making sure I didn't see the same error as him with the network unplugged |
Hi Wade,
thanks for your help. Now it works almost perfect :) I compiled JOGL yesterday for my own, used those jar's, signed them and created the .jnlp files. Guess somewhere something was wrong with some paths. It's just almost perfect because it works on my openSUSE with Firefox and Opera but does not work on an Windows XP 64bit with IE8. This is the error message: Exception in thread "thread applet-test.TriangleApplet-1" java.lang.UnsatisfiedLinkError: com.jogamp.nativewindow.impl.windows.GDI.GetCurrentProcess()J at com.jogamp.nativewindow.impl.windows.GDI.GetCurrentProcess(Native Method) at com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory.enterThreadCriticalZone(WindowsWGLDrawableFactory.java:136) at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1222) at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1192) at javax.media.opengl.GLProfile.access$000(GLProfile.java:66) at javax.media.opengl.GLProfile$1.run(GLProfile.java:112) at java.security.AccessController.doPrivileged(Native Method) at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:110) at test.TriangleApplet.init(TriangleApplet.java:22) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Got it with my own applet and the gears applet. Already changed the native jars for windows 64bit but did not help. In the .jnlp files there are links to the native files and i guess they get found. any idea? i downloaded the native libs from jogamp org using the autobuild from 13th december for all systems. thanks! |
Administrator
|
Hi Sandhase,
It looks like you're missing a native binary somehow -- this is where Michael's earlier advice becomes necessary Here's a new version of my JNLP that works cross-platform. As Michael mentioned, you need all the *-natives-*.jar files in your codebase directory (there should be 20 of them), you have to sign them all, and they need to be in the JNLP as resources. If you do it like this, you don't need the .dll and .so files like I used before. I've tested this on both Windows 32 and CentOS 64, and it works the same (except I have to change the path to the codebase). I used the autobuild b266 for this. <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="file://localhost/work/jogl2/jws/" href="GearsTestNativeJARs.jnlp"> <information> <title>JOGL Gears Demo</title> <vendor>JogAmp Community</vendor> <homepage href="http://jogamp.org/jogl-demos/"/> <description>Gears Demo</description> <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> <offline-allowed/> </information> <update check="background" policy="always"/> <security> <all-permissions/> </security> <resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="jogl.test.jar" main="true"/> <jar href="gluegen-rt.jar" /> <jar href="nativewindow.all.jar" /> <jar href="jogl.all.jar" /> <jar href="newt.all.jar" /> <jar href="ant.jar" /> <jar href="ant-junit.jar" /> <jar href="junit.jar" /> </resources> <resources os="Windows" arch="x86"> <nativelib href = "gluegen-rt-natives-windows-i586.jar" /> <nativelib href = "jogl-natives-windows-i586.jar" /> <nativelib href = "nativewindow-natives-windows-i586.jar" /> <nativelib href = "newt-natives-windows-i586.jar" /> </resources> <resources os="Windows" arch="amd64"> <nativelib href = "gluegen-rt-natives-windows-amd64.jar" /> <nativelib href = "jogl-natives-windows-amd64.jar" /> <nativelib href = "nativewindow-natives-windows-amd64.jar" /> <nativelib href = "newt-natives-windows-amd64.jar" /> </resources> <resources os="Windows" arch="x86_64"> <nativelib href = "gluegen-rt-natives-windows-amd64.jar" /> <nativelib href = "jogl-natives-windows-amd64.jar" /> <nativelib href = "nativewindow-natives-windows-amd64.jar" /> <nativelib href = "newt-natives-windows-amd64.jar" /> </resources> <resources os="Linux" arch="i386"> <nativelib href = "gluegen-rt-natives-linux-i586.jar" /> <nativelib href = "jogl-natives-linux-i586.jar" /> <nativelib href = "nativewindow-natives-linux-i586.jar" /> <nativelib href = "newt-natives-linux-i586.jar" /> </resources> <resources os="Linux" arch="x86"> <nativelib href = "gluegen-rt-natives-linux-i586.jar" /> <nativelib href = "jogl-natives-linux-i586.jar" /> <nativelib href = "nativewindow-natives-linux-i586.jar" /> <nativelib href = "newt-natives-linux-i586.jar" /> </resources> <resources os="Linux" arch="amd64"> <nativelib href = "gluegen-rt-natives-linux-amd64.jar" /> <nativelib href = "jogl-natives-linux-amd64.jar" /> <nativelib href = "nativewindow-natives-linux-amd64.jar" /> <nativelib href = "newt-natives-linux-amd64.jar" /> </resources> <resources os="Linux" arch="x86_64"> <nativelib href = "gluegen-rt-natives-linux-amd64.jar" /> <nativelib href = "jogl-natives-linux-amd64.jar" /> <nativelib href = "nativewindow-natives-linux-amd64.jar" /> <nativelib href = "newt-natives-linux-amd64.jar" /> </resources> <resources os="Mac OS X" arch="i386"> <nativelib href = "gluegen-rt-natives-macosx-universal.jar" /> <nativelib href = "jogl-natives-macosx-universal.jar" /> <nativelib href = "nativewindow-natives-macosx-universal.jar" /> <nativelib href = "newt-natives-macosx-universal.jar" /> </resources> <resources os="Mac OS X" arch="x86_64"> <nativelib href = "gluegen-rt-natives-macosx-universal.jar" /> <nativelib href = "jogl-natives-macosx-universal.jar" /> <nativelib href = "nativewindow-natives-macosx-universal.jar" /> <nativelib href = "newt-natives-macosx-universal.jar" /> </resources> <application-desc main-class="com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT"> </application-desc> </jnlp> |
Hi Wade Walker
Thanks for your answer...and now..suddenly it works. My JNLP-File was the same as you had but did not know about the B266 of jogl-files. So I downloaded the build, copied all new native jars, signed them and it worked :) Thanks :) |
Administrator
|
Excellent! Glad things are finally working I'll post this stuff on the wiki to help others in the future.
|
Administrator
|
Hi!
I will have to use Wade's indications soon, it would be really fine if someone could put them into the wiki.
Julien Gouesse | Personal blog | Website
|
Administrator
|
I'm working on it this weekend -- I may not be totally finished, but I'll publish what I've got so far.
|
Administrator
|
I've put up a first draft of how to do a Java Web Start program that uses JOGL at https://jogamp.org/wiki/index.php/Using_JOGL_in_Java_Web_Start. Tomorrow, I'll post a similar one that shows how to do an applet.
There are still some details left out (how to reduce JAR size, how to set up auto-download of Java, etc.), but this should be enough to cover the basics. |
Free forum by Nabble | Edit this page |