On Jan 29, 2004, at 5:10 PM, Michael Becke wrote:
Looks like a class loader problem. My guess is that commons-logging is being loaded by more than one class loader.
I figured that since HttpClient uses JUnit for its test suite that HttpClient had to be compatible with JUnit. Here's the most simple JUnit example showing that the latest versions of HttpClient does not run with JUnit. The example does nothing but start JUnit with the latest versions of HttpClient and commons logging and no other libraries involved:
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import junit.framework.*;
/**
* Simple example showing problem with running HttpClient code within JUnit
*/
public class HttpClientJunitBug extends TestCase
{
public HttpClientJunitBug(String s)
{
super(s);
}
public void testSimple()
{
org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient();
assertTrue( client != null );
}
}
prompt>javac HttpClientJunitBut.java
prompt>java -cp junit.jar:commons-httpclient-2.0-rc2.jar:commons-logging-api.jar:. junit.swingui.TestRunner HttpClientJunitBug
The result is:
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.comons.logging.impl.Jdk14Logger does not implement Log
I thought maybe someone who runs the HttpClient test suite regularly would be able to spot my mistake easily. (Hopefully!)
Thanks,
-------------------------------- Michael Czeiszperger czei at webperformanceinc dot com Web Performance, Inc. 919-845-7601
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]