You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Kazuhito SUGURI <su...@lab.ntt.co.jp> on 2003/12/04 13:45:11 UTC

Cactus-1.5 requires commons-httpclient.jar in server side

Hi.

I had updated Cactus from 1.4.1 to 1.5.
But ServletTestCase and FilterTestCase cannot be instantiated,
and then, no TestCase were passed.
The TestCase was invoked from JUnit testrunner (junit.swingui.TestRunner)
in client-side and the error occurs in server-side.

RE: Cactus-1.5 requires commons-httpclient.jar in server side

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Kazuhito,

Thanks. In Cactus tests we're using the <cactifywar> task which puts
commons-httpclient on the server side CP. Thus we hadn't noticed this
"issue". I've applied your patch.

Thanks
-Vincent

> -----Original Message-----
> From: Kazuhito SUGURI [mailto:suguri.kazuhito@lab.ntt.co.jp]
> Sent: 04 December 2003 13:45
> To: cactus-user@jakarta.apache.org
> Subject: Cactus-1.5 requires commons-httpclient.jar in server side
> 
> Hi.
> 
> I had updated Cactus from 1.4.1 to 1.5.
> But ServletTestCase and FilterTestCase cannot be instantiated,
> and then, no TestCase were passed.
> The TestCase was invoked from JUnit testrunner
(junit.swingui.TestRunner)
> in client-side and the error occurs in server-side.
> 
> From server (JBoss-3.2.2) logfile:
>     ERROR [org.apache.cactus.server.AbstractWebTestCaller] Error
> instantiating class [MyServletTest([testDoPost_Normal], [null])]
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> 	at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cc
> essorImpl.java:39)
> 	at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tr
> uctorAccessorImpl.java:27)
> 	at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> 	at
>
org.apache.cactus.server.AbstractWebTestCaller.getTestClassInstance(Abst
ra
> ctWebTestCaller.java:419)
> 	at
>
org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCal
le
> r.java:148)
> 	....
> 	at java.lang.Thread.run(Thread.java:534)
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/commons/httpclient/HttpMethod
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:141)
> 	at
>
org.apache.cactus.configuration.BaseConfiguration.<clinit>(BaseConfigura
ti
> on.java:94)
> 	at
org.apache.cactus.ServletTestCase.init(ServletTestCase.java:188)
> 	at
> org.apache.cactus.ServletTestCase.<init>(ServletTestCase.java:164)
> 	at MyServletTest.<init>(MyServletTest.java:264)
> 
> 
> To avoid this problem, I have to put commons-httpclient-rc2.jar
> in server-side classpath.
> 
> 
> ----
> 
> I have other way to avoid the problem.
> I got and modified cactus source code and re-build cactus-1.5.jar.
> By using the (unofficial) cactus-1.5.jar, all TestCases passed
> without commons-httpclient-rc2.jar in server-side.
> But I'm not sure that the modification is proper or not.
> The diff -p result is attatched to this message.
> 
> 
> I hope this information helps someone.
> ----
> Kazuhito SUGURI
> mailto:suguri.kazuhito@lab.ntt.co.jp