Hi,
I asked about this before and since I didn't get an answer I thought
I'd try again with more details.
HttpClient cannot be instantiated in junit.swingui.TestRunner, but
throws an ExceptionInInitializerError. I've tried this with
httpclient-2.0.2 and httpclient-3.0-rc3 and various versions of
commons-logging.jar. This is an easy bug to reproduce. Compile the
HttpClientBug class below with
javac -classpath .:commons-httpclient-2.0.2.jar:junit_3.8.1.jar
HttpClientBug.java
The class cannot be run without commons-logging.jar in the classpath,
since without it org/apache/commons/logging/LogFactory cannot be
found. However, if commons-logging.jar is included, then this will
pass:
java -cp .:commons-httpclient-2.0.2.jar:commons-logging.jar:junit_3.8.1.jar
junit.textui.TestRunner HttpClientBug
and this will fail:
java -cp .:commons-httpclient-2.0.2.jar:commons-logging.jar:junit_3.8.1.jar
junit.swingui.TestRunner HttpClientBug
I've verified it on Linux and WinXP with Java 1.5. The Error messsage
complains that "You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed," but
the only one is in commons-logging.jar. Does anyone have a clue to
what is going on here?
Thanks,
Glenn
import junit.framework.TestCase;
import org.apache.commons.httpclient.HttpClient;
public class HttpClientBug extends TestCase {
public void testIt() {
System.out.println("Yo, "+System.getProperty("user.name")+"!");
HttpClient client = new HttpClient();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]