hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Mason <alex.ma...@mnetcorporation.com>
Subject commons-logging problem with httpclient
Date Fri, 10 Dec 2004 01:43:48 GMT
Hi all,

The problem I'm having is that when I attempt to instantiate the 
HttpClient I get an error "Invalid class loader hierarchy.  You have 
more than one version of 'org.apache.commons.logging.Log' visible, which 
is not allowed." (full trace below).  The thing is this should not be 
possible, the only other jars I have in my application WEB-INF/lib 
directory are either my code, log4j.jar, commons-httpclient-2.0.1.jar 
and commons-logging.jar

Removal of the commons-logging.jar leads to a class not found exception 
relating to the LogFactory.

As far as I can see there are no other jars present in the classpath 
that use commons logging at all.  Log4j is the only thing I can think of 
that could possibly be causing any problems.  I do have multiple webapps 
that use the HttpClient however.  Yet each webapp is a seperate entity 
with seperate classes loaded...

I've found that by moving the HttpClient instantiation into the init() 
method of my main servlet I can avoid this problem, however this is more 
a hack than good programming and not something I feel comfortable 
putting into production...

Any help would be most appreciated,
Sincerely,
Alex


<stack trace at this point is leading to the line in my class that 
attempts to instantiate the HttpClient>
Caused by: org.apache.commons.logging.LogConfigurationException: 
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.) (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.))
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
[11:18:13.728]  at 
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
[11:18:13.728]  at 
org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:69)
[11:18:13.728]  ... 12 more
[11:18:13.728] 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.)
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
[11:18:13.728]  ... 16 more
[11:18:13.728] 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.
[11:18:13.728]  at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
[11:18:13.728]  ... 17 more


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message