Re: Httpclient won't run in JUnit

2004-01-31 Thread Michael Czeiszperger
On Jan 31, 2004, at 6:26 AM, Oleg Kalnichevski wrote:

I confirm that the problem is perfectly reproducible with Sun JDK 1.2.2
(simple logger used per default) and Sun JDK 1.4.2 (JDK logger used per
default). However, what I discovered is that the problem occurred only
when using SwingUI. The same code runs without a hitch using TextUI.
I understand it's a small comfort to you, but the problem does not seem
to be caused by HttpClient. Try approaching JUnit people to see if they
know of any compatibility issues between JUnit's SwingUI and
commons-logging
Thank you very much for taking the time to look at this, I really 
appreciate it. It does seem that the problem is probably in JUnit, so 
I'll focus attention in that area.

Warm regards,


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]


Re: Httpclient won't run in JUnit

2004-01-31 Thread Oleg Kalnichevski
Michael,
I confirm that the problem is perfectly reproducible with Sun JDK 1.2.2
(simple logger used per default) and Sun JDK 1.4.2 (JDK logger used per
default). However, what I discovered is that the problem occurred only
when using SwingUI. The same code runs without a hitch using TextUI. 

I understand it's a small comfort to you, but the problem does not seem
to be caused by HttpClient. Try approaching JUnit people to see if they
know of any compatibility issues between JUnit's SwingUI and
commons-logging

Oleg


On Sat, 2004-01-31 at 03:24, Michael Czeiszperger wrote:
> 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]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Httpclient won't run in JUnit

2004-01-30 Thread Michael Czeiszperger
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]


Re: Httpclient won't run in JUnit

2004-01-30 Thread Michael Czeiszperger
On Jan 30, 2004, at 3:44 AM, Ortwin Glück wrote:



Michael Czeiszperger wrote:
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
This happens when there is an old version of commons-logging in the 
classpath. Please check if you can update to a later version.

Thanks for the help. I'm using commons-logging 1.0.3, which appears to 
be the latest version available.


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]


Re: Httpclient won't run in JUnit

2004-01-30 Thread Ortwin Glück


Michael Czeiszperger wrote:
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
This happens when there is an old version of commons-logging in the 
classpath. Please check if you can update to a later version.

Odi

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Httpclient won't run in JUnit

2004-01-29 Thread Michael Becke
Hi Michael,

Looks like a class loader problem.  My guess is that commons-logging is 
being loaded by more than one class loader.

Mike

On Jan 29, 2004, at 4:43 PM, Michael Czeiszperger wrote:

I apologize for asking a user-type question on the dev list, but the 
common's user list was unable to help, and I've been working on this 
for two weeks with no luck.  HttpClient is supposed to work within 
JUnit since there's a test suite that uses JUnit. Unfortunately 
whenever I try to use HttpClient within JUnit, as in this one line 
instantiation:

org.apache.commons.httpclient.HttpClient client = new 
org.apache.commons.httpclient.HttpClient();

what happens looks like a class loader error:

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

It looks just like a class loader problem, but if HttpClient is tested 
from within JUnit there wouldn't be fundamental problems like this, so 
there's gotta be something wrong with what I'm doing.

Note:

I verified this with a couple of different JDK versions (1.4 and 1.5), 
on both Windows and OSX.  (1.5 isn't available for OSX yet, and so 
that wasn't tested.)

Thanks for any pointers-- I'd like to be able to use HttpClient.


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]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Httpclient won't run in JUnit

2004-01-29 Thread Oleg Kalnichevski
Michael,
HttpClient is dependent on commons-logging library like many other
Jakarta Commons components. You have to have commons-logging.jar on your
classpath to be able to run HttpClient.  

You can obtain the commons-logging.jar at the following location:

http://jakarta.apache.org/commons/logging.html

This should help

Oleg


On Thu, 2004-01-29 at 22:43, Michael Czeiszperger wrote:
> I apologize for asking a user-type question on the dev list, but the 
> common's user list was unable to help, and I've been working on this 
> for two weeks with no luck.  HttpClient is supposed to work within 
> JUnit since there's a test suite that uses JUnit. Unfortunately 
> whenever I try to use HttpClient within JUnit, as in this one line 
> instantiation:
> 
> org.apache.commons.httpclient.HttpClient client = new 
> org.apache.commons.httpclient.HttpClient();
> 
> what happens looks like a class loader error:
> 
> 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
> 
> It looks just like a class loader problem, but if HttpClient is tested 
> from within JUnit there wouldn't be fundamental problems like this, so 
> there's gotta be something wrong with what I'm doing.
> 
> Note:
> 
> I verified this with a couple of different JDK versions (1.4 and 1.5), 
> on both Windows and OSX.  (1.5 isn't available for OSX yet, and so that 
> wasn't tested.)
> 
> Thanks for any pointers-- I'd like to be able to use HttpClient.
> 
> 
> 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]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]