users@glassfish.java.net

Apache commons Logging classpath problem

From: <forums_at_java.net>
Date: Tue, 19 Jul 2011 11:31:01 -0500 (CDT)

I am working on switching from JBoss to GlassFish and I have encountered an
Apache commons logging classpath problem I can not find a solution for.  My
EAR includes the following hibernate dependency which has a dependency on
commons-logging.

<dependency> <groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId> <version>3.2.4.sp1</version> </dependency>
When commons-logging is put into my EAR and I try to deploy my beans I get
this exception:

Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy. You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed. (Caused by
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy. You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed.)
When I EXCLUDE the dependency on commons-loging so it is NOT put into my EAR,
then I get this exception:

[#|2011-07-19T11:25:50.338-0500|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=88;_ThreadName=Thread-1;|
Exception while preparing the app : org/apache/commons/logging/LogFactory
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at
com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
at
com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at
java.lang.ClassLoader.loadClass(ClassLoader.java:248)
So I need some help figuring out what is going on here.  It seems to me it's
not possible to have a "more than one version" problem in one case and a "not
found" problem in the other case.

 

 


--
[Message sent by forum member 'mjremijan']
View Post: http://forums.java.net/node/824149