JBoss 4.0.4: Classloader not found exception when deploying
engela Jul 22, 2008 6:06 AM(JBoss 4.0.4, JDK 1.5)
I have two web applications, which are using the same jar file and are to be deployed on the same JBoss AS instance. In both cases the jar file will be included in the WEB-INF/lib, as potentially they will be using different version of the jar file. Both appplications are running fine when deployed on two different machines. However I have problems when deploying both WAR files on the same JBoss AS instance: For one particular command I get a Exception:
1:05:54,114 ERROR [[schedulerServiceExporter]] Servlet.service() for servlet schedulerServiceExporter threw exception java.lang.ClassNotFoundException: No ClassLoaders found for: com.dns.quartz.jobs.RunTaskJob at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306) at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511) at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:585) at org.springframework.remoting.rmi.CodebaseAwareObjectInputStream.resolveClass(CodebaseAwareObjectInputStream.java:104) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1433) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) at org.springframework.remoting.rmi.RemoteInvocationSerializingExporter.doReadRemoteInvocation(RemoteInvocationSerializingExporter.java:124) at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.readRemoteInvocation(HttpInvokerServiceExporter.java:117) at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.readRemoteInvocation(HttpInvokerServiceExporter.java:96)
After reading:
http://wiki.jboss.org/wiki/ClassLoadingConfiguration
http://java2.5341.com/msg/68202.html
I tried several scenarios to solve my problem but neither of these have worked:
1. Set the attribute Java2ClassLoadingCompliance in JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\conf\jboss-server.xml to a) true and b) false
2. Add the line to the jboss-web.xml of the first war file:
<loader-repository>com.dns:loader=my-webapp1.war</loader-repository>
and add the line tothe jboss-web.xml of the second war file
<loader-repository>com.dns:loader=my-webapp2.war</loader-repository>
3. Add the lines to both jboss-web.xml:
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
I am running out of ideas. Did anyone have similar problems and found a work around?
Thanks,
Anette