Log4J “NoSuchMethodError” for org/apache/log4j/Logger.trace(Ljava/lang/Object;)V
My application uses log4J and when I deployed to our development server, I was getting the following exception:
CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method “onMessage” on bean “BeanId(LoggingEAR#LoggingEJB.jar#LoggingExceptionMDB, null)”. Exception data: java.lang.NoSuchMethodError: org/apache/log4j/Logger.trace(Ljava/lang/Object;)V
At first, I believed that this was caused by Log4J not being on the classpath in ear. Upon further inspection, it’s not a ClassNotFoundException but a NoSuchMethodError.
I looked at the classpath of my EJB and discovered that oracle had installed it’s own copy of Log4J onto the server classpath and this older version did not have the trace() method.
Related Posts
- WebSphere 6.1 and Jakarta Commons Logging (JCL) using Log4J in an EJB
- Where’s that class being loaded from? - Which4J
- Profile Creation on WebSphere Application Server 6.1.0.19 Fails with Certificate Error
- Oracle XA_RMERR & Spring Oracle LOB Handler Exceptions
- javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package {0}
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply