hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: commons-logging problem with httpclient
Date Fri, 10 Dec 2004 05:04:12 GMT
Hi Alex,

This is a pretty contentious issue in the Jakarta community, as you can  
see from Eric's response.  Generally the problem is that  
commons-logging is included on the servlet or common classloader.  The  
URL included in Eric's email describes the problem quite well, and it  
should be helpful in debugging the problem.  I would also suggest  
sending an email to commons-user or commons-dev if you continue to have  
problems.

Mike

On Dec 9, 2004, at 8:43 PM, Alex Mason wrote:

> 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(LogFactoryIm 
> pl.java:543)
> [11:18:13.728]  at  
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryIm 
> pl.java:235)
> [11:18:13.728]  at  
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryIm 
> pl.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(LogFac 
> toryImpl.java:397)
> [11:18:13.728]  at  
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryIm 
> pl.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(LogFac 
> toryImpl.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
>


---------------------------------------------------------------------
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