View Full Version : Runtime Exception: WorldWindowGLAutoDrawable
rogene
07-24-2007, 08:16 PM
Hello,
I am looking for some hints as to the source of this applet runtime error ---
<html>
<applet code=DemoApplet.class
archive="DemoApplet.jar, worldwind.jar, gluegen-rt.jar, jogl.jar"
</applet>
</html>
gov.nasa.worldwind.WWRuntimeException: Unable to create WorldWindow
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(Unknown Source)
at DemoApplet.createWindow(DemoApplet.java: 25)
at DemoApplet.init(DemoApplet.java:37)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.setAutoSwapB ufferMode(GLJPanel.java:812)
at gov.nasa.worldwind.WorldWindowGLAutoDraw able.<init>(Unknown Source)
... 5 more
gov.nasa.worldwind.WWRuntimeException: Unable to create WorldWindow
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(Unknown Source)
at DemoApplet.createWindow(DemoApplet.java: 25)
at DemoApplet.init(DemoApplet.java:37)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.setAutoSwapB ufferMode(GLJPanel.java:812)
at gov.nasa.worldwind.WorldWindowGLAutoDraw able.<init>(Unknown Source)
... 5 more
Thanks!
toolshed
07-25-2007, 12:44 AM
gov.nasa.worldwind.WWRuntimeException: Unable to create WorldWindow
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(Unknown Source)
Look here (http://issues.worldwind.arc.nasa.gov/browse/WWJ-61)
patmurris
07-25-2007, 01:21 AM
Do you have jogl in the classpath for the applet ?
rogene
07-25-2007, 01:51 AM
Thanks!
I changed the applet tag as such:
<applet code="com.sun.opengl.util.JOGLAppletLauncher"
width=800
height=600
codebase="file:\\C:\Users\rogene\Desktop\runme\"
archive="jogl.jar,gluegen-rt.jar,worldwind.jar,BasicDemo.jar,DemoA pplet.jar">
<param name="subapplet.classname" VALUE="DemoApplet">
<param name="subapplet.displayname" VALUE="WorldWind">
<param name="progressbar" value="true">
<param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,worldwind.jar,BasicDemo.jar,DemoA pplet.jar">
<param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload,worldwind.jar;preload,Bas icDemo.jar;preload,DemoApplet.jar;preloa d">
</applet>
And the runtime error goes away. However, I think that I must have an error in the codebase because the error now is that the DemoApplet class isn't found.
I have tried several variations on the codebase definition based on what I saw others post. I am debugging from a folder off the desktop, rather than on a webserver. I just started digging around on the Sun site to see if I could find some additional pointers, as this now appears to be a Java issue, rather than a Worldwind issue.
I am *not* running this on a Mac, which was related to a problem that another ww poster described.
rogene
07-25-2007, 03:09 AM
I have tried using
codebase = "."
as well as deleting the reference to it completely
<param name="subapplet.classname" VALUE="DemoApplet">
Is your DemoApplet class in a java package ?
type exemplepackage.DemoApplet if so.
patmurris
07-25-2007, 11:19 AM
Sun recommend using the new JNLPAppletLauncher instead of JOGLAppletLauncher.
One of the main advantages is you dont need to host copies of all versions of jogl and gluegen. You can point to Sun servers. Same for the launcher itself.
https://applet-launcher.dev.java.net/
Sun recommend using the new JNLPAppletLauncher instead of JOGLAppletLauncher.
One of the main advantages is you dont need to host copies of all versions of jogl and gluegen. You can point to Sun servers. Same for the launcher itself.
https://applet-launcher.dev.java.net/
JNLP Launcher seems better for those who don't develop on some platform like me because there is a serious issue with JNLP core. JNLP applet tag parser seems not understand xml standard declaration like this :
<applet ....>
<param />
<param />
</applet>
JSP 2.0 or later can't understand old HTML tag and throws a fatal error, JNLP only understand old HTML tag and crash on xml standard ...
To force creation of wwd, use WorldWindGLCanvas instead of WorldWindGLJPanel, the second one seems not working at all.
rogene
07-25-2007, 06:30 PM
Thanks for the great ideas!
1) Use Canvas instead of JPanel
Will this be a problem if I am using JApplet? I had planned to use Swing components. Any issues mixing heavyweight and lightweight components, i.e. can I add the Canvas directly to my contentPane?
2) Use full package name in the subapplet.classname value
I am not using a package at this time. Should I be?
3) Use the new JNLPAppletLauncher instead of JOGLAppletLauncher
I am just learning about this now. I spent some time on SUN's forums but each page was S-L-O-W and I could never get the site to allow me to post a message. Many of the messages have been sitting out there without reply for quite a while. There is a forum at javagaming.org that is on a fast(er) server and has an active community.
Have any of you used the JNLP version of the AppletLauncher? I am running on two platforms - my quick debugs are on Windows Vista and my dev web server is 64-bit Linux with Apache and Tomcat.
Thanks so much!
Thanks for the great ideas!
1) Use Canvas instead of JPanel
Will this be a problem if I am using JApplet? I had planned to use Swing components. Any issues mixing heavyweight and lightweight components, i.e. can I add the Canvas directly to my contentPane?
I don't have any problem with my own applet, the mix seems ok. But you don't have much choice : WorldWindGLJPanel isn't working. I have tried some refactoring without rapid success so I keeped my GLCanvas solution. ( Issue reported on JIRA ).
2) Use full package name in the subapplet.classname value
I am not using a package at this time. Should I be?
This is just dev tips, I just would want to verify this point with you but the problem is certainly with the GLJPanel point.
3) Use the new JNLPAppletLauncher instead of JOGLAppletLauncher
I am just learning about this now. I spent some time on SUN's forums but each page was S-L-O-W and I could never get the site to allow me to post a message. Many of the messages have been sitting out there without reply for quite a while. There is a forum at javagaming.org that is on a fast(er) server and has an active community.
Have any of you used the JNLP version of the AppletLauncher? I am running on two platforms - my quick debugs are on Windows Vista and my dev web server is 64-bit Linux with Apache and Tomcat.
Thanks so much!
I don't use JNLP because I have encountered some bug with my webapp. But it seems JNLP is the new "standard" applet launcher with native libraries.
rogene
07-25-2007, 08:19 PM
You are right - I don't have a choice until the next release! I will get working on this modification next.
But I don't think this is the source of the "class not found" problem wrt my DemoApplet.class.
Do you package all your applets?
Thanks!
rogene
07-25-2007, 10:05 PM
I tried packaging the class and modifying the html applet tag, and still gert a runtime 'class not found' error. The AppletLauncher initialzes, but the Java Console reports that my DemoApplet class is not found.
Same issue in IE and Firefox.
I am cross posting to a java site, too.
I tried packaging the class and modifying the html applet tag, and still gert a runtime 'class not found' error. The AppletLauncher initialzes, but the Java Console reports that my DemoApplet class is not found.
Same issue in IE and Firefox.
I am cross posting to a java site, too.
Just to know, how do you pack your app ? Do you use the Ant file with SDK ? If so do you have modified this one to add your class in the compile process ? I personnaly use the ant from sdk and each time I add a new package I have to modify the build.xml. Ant task is also usefull to auto sign packages with keytool ^^.
rogene
07-25-2007, 11:21 PM
There is only one file, so I just added "package opinionmap" to the top of the file.
And then I converted to a jar using:
jar cvf DemoApplet.jar DemoApplet.class
and signed with jarsigner
patmurris
07-26-2007, 01:43 AM
There is only one file, so I just added "package opinionmap" to the top of the file...
Then you should probably use :
<param name="subapplet.classname" VALUE="opinionmap.DemoApplet">
rogene
07-26-2007, 02:05 AM
Yes - I did this already.
I am currently investigating whether the jar file is malformed or something.... I found the following command line to hang --
jar t DemoApplet.jar
I moved everything over to my linux machine to eliminate any issues with the Vista/Cygwin environment.
More soon...! (Hopefully, a victory song...)
See inside jar with a zip tool such as Winrar and verify content.
rogene
07-26-2007, 11:14 PM
Success!!! :-)
Thanks for your help! Time to get to the good stuff - playing with the model!
joeclarkia2
11-28-2012, 08:12 PM
I see this NPE in setAutoSwapBufferMode() problem with WorldWind when moving my application from a 32-bit to 64-bit environment. I believe that I'm using the correct JOGL libraries and paths for each, but WorldWind works correctly on the 32-bit machine but generates this error on the 64-bit machine. Any ideas why that might be?
vBulletin® v3.7.1, Copyright ©2000-2013, Jelsoft Enterprises Ltd.