14 July 2008 - java_dev (original) (raw)
Hi all,
I have an app that can run both stand-alone and as a webstart application. There are plug-in classes, which are loaded by class name according to a system property, using the Class.forName() method. Most of these plugins are referenced in the application, i.e. are linked staticaly, if this term is applicable here. However, I've added a class (let's call it X) that's not referenced by the application, i.e. is linked dynamically. That was actually the idea to begin with, and the statically-linked plug-ins are legacy classes, anyway.
The strange thing is all the plug-ins, including X, load successfully when the app is executed stand-alone. However, when the same app is executed as a webstart, class X cannot be loaded -- I get a ClassNotFoundException. The whole application is packed into one jar file, and the class is definitely there, so it's not a classpath problem. Different classloaders are used. When running stand-alone, it's sun.misc.Launcher$AppClassLoader, in webstart, it's com.sun.jnlp.JNLPClassLoader.
Does anyone have any idea what the problem might be?
Thanks in advance,
Sergei