Return-Path: Delivered-To: apmail-jakarta-httpclient-dev-archive@www.apache.org Received: (qmail 3425 invoked from network); 10 Dec 2004 05:04:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Dec 2004 05:04:24 -0000 Received: (qmail 94954 invoked by uid 500); 10 Dec 2004 05:04:22 -0000 Delivered-To: apmail-jakarta-httpclient-dev-archive@jakarta.apache.org Received: (qmail 94935 invoked by uid 500); 10 Dec 2004 05:04:22 -0000 Mailing-List: contact httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "HttpClient Project" Reply-To: "HttpClient Project" Delivered-To: mailing list httpclient-dev@jakarta.apache.org Received: (qmail 94921 invoked by uid 99); 10 Dec 2004 05:04:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mxout3.cac.washington.edu (HELO mxout3.cac.washington.edu) (140.142.32.166) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Dec 2004 21:04:21 -0800 Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout3.cac.washington.edu (8.13.1+UW04.08/8.13.1+UW04.09) with ESMTP id iBA54KLc027687 for ; Thu, 9 Dec 2004 21:04:20 -0800 Received: from [10.0.1.2] (pool-68-239-49-24.bos.east.verizon.net [68.239.49.24]) (authenticated bits=0) by smtp.washington.edu (8.13.1+UW04.08/8.13.1+UW04.12) with ESMTP id iBA54ICM015690 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 9 Dec 2004 21:04:19 -0800 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <41B8FF54.2070706@mnetcorporation.com> References: <41B8FF54.2070706@mnetcorporation.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Michael Becke Subject: Re: commons-logging problem with httpclient Date: Fri, 10 Dec 2004 00:04:12 -0500 To: "HttpClient Project" X-Mailer: Apple Mail (2.619) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 > > > 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.(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