[jboss-user] [Beginners Corner] - Classloader problem with log4j
reinhard.graf
do-not-reply at jboss.com
Tue Jun 5 06:47:47 EDT 2007
Hi,
I want to have my own log4j.xml in my application. Therefore I implemented a RepositorySelector as suggested in
the JBoss documentation.
But on startup I get following error:
java.lang.NoSuchMethodError: org.apache.log4j.spi.RootCategory.(Lorg/apache/log4j/Priority;)V
at com.soultec.trueAct.logger.AppRepositorySelector.init(AppRepositorySelector.java:47)
at com.soultec.trueAct.listener.ContextListener.contextInitialized(ContextListener.java
in the <JBOSS_HOME>/server/defautl/lib folder, there is the log4j-1.2.13.jar.
But it seems, that the JBoss uses the log4j-boot.jar from the <JBOSS_HOME>/lib folder.
Here is the structure of my ear-file:
MyApp.ear
+ MyApp.war
+ META-INF
+ myjar.jar
The RepositorySelector is initialized in a ServletContextListener which is in myjar.jar.
In my application.xml i have an entry
<module><java>myjar.jar</java></module>
Please can somebody help me ?
Here is the output of the jmx-console:
org.apache.log4j.spi.RootCategory Information
Repository cache version:
org.apache.log4j.spi.RootCategory(1506dc4).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader at 10f6d3
..org.jboss.system.server.NoAnnotationURLClassLoader at 10f6d3
..sun.misc.Launcher$AppClassLoader at a39137
....file:/C:/Java/jdk1.5.0_09/lib/tools.jar
....file:/C:/Java/jboss-4.0.5.GA/bin/run.jar
..sun.misc.Launcher$ExtClassLoader at 92e78c
....file:/C:/Java/jdk1.5.0_09/jre/lib/ext/dnsns.jar
....file:/C:/Java/jdk1.5.0_09/jre/lib/ext/localedata.jar
....file:/C:/Java/jdk1.5.0_09/jre/lib/ext/sunjce_provider.jar
....file:/C:/Java/jdk1.5.0_09/jre/lib/ext/sunpkcs11.jar
++++CodeSource: (file:/C:/Java/jboss-4.0.5.GA/lib/log4j-boot.jar )
Implemented Interfaces:
### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3 at 2c9103{ url=null ,addedOrder=2}
### Instance1 via UCL: org.jboss.system.server.NoAnnotationURLClassLoader at 10f6d3
Regards
Reinhard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051263#4051263
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051263
More information about the jboss-user
mailing list