classloading problems of a custom principal
demarcojb Jan 26, 2011 6:33 AMI'm getting the following error if I'm trying to call a server method of my application.
12:29:21,876 ERROR [org.jboss.remoting.transport.socket.ServerThread] WorkerThread#1[127.0.0.1:2860]
exception occurred during first invocation: java.lang.ClassNotFoundException: myapp.security.MyPrincipal
at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [:1.6.0_14]
at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_14]
at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [:1.6.0_14]
at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [:1.6.0_14]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [:1.6.0_14]
at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_14]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_14]
at java.lang.Class.forName0(Native Method) [:1.6.0_14]
at java.lang.Class.forName(Class.java:247) [:1.6.0_14]
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java
:284) [jboss-classloader.jar:2.2.0.GA]
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java
:1152) [jboss-classloader.jar:2.2.0.GA]
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:8
86) [jboss-classloader.jar:2.2.0.GA]
at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jbo
ss-classloader.jar:2.2.0.GA]
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss
-classloader.jar:2.2.0.GA]
at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_14]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_14]
at java.lang.Class.forName0(Native Method) [:1.6.0_14]
The custom principal class is in a simple jar-file. This jar-file is placed in the ear module (lib directory).
During deployment the classes in this package are found by the deployer, because I didn't get any errors and some of the classes in this package are also part of
the interfaces in this module.
This method is working fine in jboss 5.0 because, I haven't any problems with this solution.
If I'm deploying the jar-file as a simple jar file in the deployment directory of jb6 or if I copy the simple jar file in the default/lib directory it works.
But this solution is not good, because the jar files are part of the application und should'nt be accessable by any other applications.
Is it a bug or any ideas deploying the principal class in a application context in jb6.
Thx and best regards,
Marco