Skip to main content

Java Web start problem

1 reply [Last post]
jfp
Offline
Joined: 2013-03-27
Points: 0

I am developping a program which builds scenegraphs. You can find it here :
http://cliper.pagesperso-orange.fr/launch.html.
Deployment is from Java Web Start.
Scenes saving/reading is made with SceneGraphFileReader/Writer. And all this works fine when running from the IDE (Netbeans) but from JWStart I can't open a saved scene and get error message : java.io.IOException: Error Loading State Class com.sun.j3d.utils.scenegraph.io....null pointer...
line 1505 where error occurs contains :
BranchGroup decorBg = reader.readBranchGraph(0)[0];
Any idea?
Thank you for help
jf Pauly

AttachmentSize
bug.txt9.69 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jfp
Offline
Joined: 2013-03-27
Points: 0

I could fix the problem looking a comment in file :
package com.sun.j3d.utils.scenegraph.io.retained; file : class Controller
Here is part of code :
/**
* When running the application within webstart this may not be the
* correct ClassLoader. If Java 3D is not installed in the local vm and
* is instead installed by webstart then this definitely is NOT the correct
* classloader, in this case Thread.getCurrent().getClass().getClassLoader()
* would probably be a good default. The user can also set their preferred
* classloader by calling setClassLoader in SceneGraph[Stream|File]Reader.
*/
protected ClassLoader classLoader = ClassLoader.getSystemClassLoader();
Finally it works with one line inserted after SceneGraphFileReader definition :
reader.setClassLoader(this.getClass().getClassLoader());