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 Patrick Lightbody <pl...@hotmail.com> on 2002/05/03 03:00:31 UTC

Re: Orion 1.5.4 and Cactus 1.3 (Why cactus?)

Because I haven't been able to find a solution to this, I'm resorting to
using straight JUnit in a JSP:

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    TestRunner runner = new TestRunner(new PrintStream(baos));
    runner.doRun(MetadataTest.suite(), false);
    out.print(new String(baos.toByteArray()));

This seems to work just as well as Cactus, to be quite honest. Can someone
give me some reasons why I should keep trying to wrestle with Cactus? :)

-Pat

----- Original Message -----
From: "Patrick Lightbody" <pl...@hotmail.com>
To: <ca...@jakarta.apache.org>
Sent: Thursday, May 02, 2002 11:42 AM
Subject: Re: Orion 1.5.4 and Cactus 1.3


> It works for me too on Orion, but only until I redeploy the app. Then it
> bombs out with that ClassCastException. If you do try Orion tonight, grab
> the OSWorkflow CVS and build with "ant example". Then deploy
> osworkflow_example.ear and try running the testcase. It should work. Then
> tough web.xml or application.xml (orion unpacks the ear) and try again, it
> should fail. :(
>
> -Pat
>
>
> >From: "Rajagopal. V" <ra...@yahoo.com>
> >Reply-To: "Cactus Users List" <ca...@jakarta.apache.org>
> >To: Cactus Users List <ca...@jakarta.apache.org>
> >Subject: Re: Orion 1.5.4 and Cactus 1.3
> >Date: Thu, 2 May 2002 11:38:45 -0700 (PDT)
> >
> >Hi Pat,
> >This is what I tried and what i got. It ran perfectly
> >alright on weblogic 6.1.. This is the output
> >
> >     [junit] Running BasicTest
> >     [junit] URL:
> >http://localhost:7001/CactusTest/ServletRedirector?Cactus_TestM
>
>ethod=testFoo&Cactus_TestClass=BasicTest&Cactus_AutomaticSession=true&Cactu
s_Ser
> >vice=CALL_TEST
> >     [junit] Response Code:200
> >     [junit] URL:
> >http://localhost:7001/CactusTest/ServletRedirector?Cactus_Servi
> >ce=GET_RESULTS
> >     [junit] Response Code:200
> >     [junit] URL:
> >http://localhost:7001/CactusTest/ServletRedirector?Cactus_TestM
>
>ethod=testBar&Cactus_TestClass=BasicTest&Cactus_AutomaticSession=true&Cactu
s_Ser
> >vice=CALL_TEST
> >     [junit] Response Code:200
> >     [junit] URL:
> >http://localhost:7001/CactusTest/ServletRedirector?Cactus_Servi
> >ce=GET_RESULTS
> >     [junit] Response Code:200
> >     [junit] Tests run: 2, Failures: 1, Errors: 0, Time
> >elapsed: 0.231 sec
> >     [junit] Testsuite: BasicTest
> >     [junit] Tests run: 2, Failures: 1, Errors: 0, Time
> >elapsed: 0.231 sec
> >     [junit]
> >     [junit] Testcase: testFoo took 0.171 sec
> >     [junit] Testcase: testBar took 0.06 sec
> >     [junit]     FAILED
> >     [junit] null
> >     [junit] junit.framework.AssertionFailedError
> >     [junit]     at
> >junit.framework.Assert.fail(Assert.java:65)
> >     [junit]     at
> >junit.framework.Assert.assertTrue(Assert.java:38)
> >     [junit]     at
> >junit.framework.Assert.assertTrue(Assert.java:45)
> >     [junit]     at BasicTest.testBar(Unknown Source)
> >
> >     [junit]     at
> >java.lang.reflect.Method.invoke(Native Method)
> >     [junit]     at
> >org.apache.cactus.AbstractTestCase.runServerTest(AbstractTest
> >Case.java:524)
> >     [junit]     at
> >org.apache.cactus.AbstractTestCase.runBareServerTest(Abstract
> >TestCase.java:490)
> >     [junit]     at
> >org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTe
> >stCaller.java:150)
> >     [junit]     at
> >org.apache.cactus.server.AbstractTestController.dispatch79_ha
>
>ndleRequest(AbstractTestController.java;org/apache/cactus/util/log/LogAspec
t.jav
> >a(1k):123)
> >     [junit]     at
> >org.apache.cactus.server.AbstractTestController.around79_hand
>
>leRequest(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.
java(
> >1k):1147)
> >     [junit]     at
> >org.apache.cactus.server.AbstractTestController.handleRequest
>
>(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):
101)
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.dispatch88_doP
>
>ost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k
):132
> >)
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.around88_doPos
>
>t(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):
1147)
> >
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.doPost(Servlet
> >TestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):118)
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.dispatch87_doG
>
>et(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k)
:105)
> >
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.around87_doGet
>
>(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):1
147)
> >     [junit]     at
> >org.apache.cactus.server.ServletTestRedirector.doGet(ServletT
> >estRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> >     [junit]     at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> >     [junit]     at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >     [junit]     at
> >weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servl
> >etStubImpl.java:265)
> >     [junit]     at
> >weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java
> >:21)
> >     [junit]     at
> >weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChai
> >nImpl.java:27)
> >     [junit]     at
> >weblogic.servlet.internal.WebAppServletContext.invokeServlet(
> >WebAppServletContext.java:2501)
> >     [junit]     at
> >weblogic.servlet.internal.ServletRequestImpl.execute(ServletR
> >equestImpl.java:2204)
> >     [junit]     at
> >weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> >
> >     [junit]     at
> >weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >     [junit]
> >
> >BUILD FAILED
> >
> >There are some debug statements with the URLs, thats
> >not part of Cactus, thats what i did to know whats
> >going on inside Cactus, so please ignore that.
> >Other than that, i got one test working and one failed
> >as per the testcase u wrote..
> >
> >If you need, i can send you the ant file that i use
> >with the weblogic extension. Ive never played with
> >Orion, maybe i should try it tonite.
> >
> >Cheers
> >Raj
> >
> >--- Patrick Lightbody <pl...@hotmail.com> wrote:
> > > I'm told a possible cause of the problem is that
> > > Cactus is placing a
> > > non-serializable object in the session or servlet
> > > context. Could this be a
> > > reason? I'm pretty much exhausted with ideas... I've
> > > got my test case in
> > > public CVS (OSWorkflow from www.opensymphony.com),
> > > if anyone wants to take a
> > > quick peak... :)
> > >
> > > -Pat
> > >
> > > ----- Original Message -----
> > > From: "Patrick Lightbody" <pl...@hotmail.com>
> > > To: <ca...@jakarta.apache.org>
> > > Sent: Wednesday, May 01, 2002 9:16 PM
> > > Subject: Re: Orion 1.5.4 and Cactus 1.3
> > >
> > >
> > > > Nope, my test case isn't even an EJB (it's nothing
> > > more than a single
> > > line,
> > > > testFoo() { assertTrue(true); }. The cactus and
> > > junit libs are in
> > > > WEB-INF/lib and the test case has nothing to do
> > > with EJBs. This happens
> > > > after I touch application.xml, which tells orion
> > > to reload the entire EAR,
> > > > even if nothing has changed. Very strange indeed.
> > > I stepped through the
> > > code
> > > > and did a watch on the line causing this
> > > ClassCastException. The first
> > > time,
> > > > ".... instanceof AbstractTestCase" returns true,
> > > but after the EAR
> > > reloads,
> > > > the same expression results in false!
> > > >
> > > > -Pat
> > > >
> > > >
> > > > >From: "Rajagopal. V" <ra...@yahoo.com>
> > > > >Reply-To: "Cactus Users List"
> > > <ca...@jakarta.apache.org>
> > > > >To: Cactus Users List
> > > <ca...@jakarta.apache.org>
> > > > >Subject: Re: Orion 1.5.4 and Cactus 1.3
> > > > >Date: Wed, 1 May 2002 20:08:52 -0700 (PDT)
> > > > >
> > > > >Patrick,
> > > > >From the StackTrace, it looks like a
> > > > >ClassCastException. One of the reasons why this
> > > > >happens(as far as Weblogic is concerned) is if
> > > you
> > > > >have the same classes in a jar and war. In this
> > > case,
> > > > >there is a separate classloader created for jar
> > > and
> > > > >another classloader for the war. This causes a
> > > > >ClasscastException. It should typically go in a
> > > EAR
> > > > >which means a single classloader loads both the
> > > jar
> > > > >and war.
> > > > >
> > > > >In your case, do you have any files that were
> > > updated
> > > > >in the Cactus war but not in the EJB jar or the
> > > other
> > > > >way?
> > > > >Can you let us know the directory structure of
> > > the jar
> > > > >and war files that you use?
> > > > >
> > > > >Cheers
> > > > >Raj
> > > > >
> > > > >--- Patrick Lightbody <pl...@hotmail.com>
> > > wrote:
> > > > > > I'm just starting to use cactus 1.3, and I got
> > > a
> > > > > > _very_ simple test suite
> > > > > > working. But when I redeploy the application
> > > and run
> > > > > > the test suite again
> > > > > > (even if nothing changed, the app was just
> > > > > > redeployed), I get this error. I
> > > > > > can only resolve it once I restart Orion...
> > > very
> > > > > > strange...
> > > > > >
> > > > > > 1)
> > > testFoo(com.opensymphony.workflow.test.BasicTest)
> > > > > > javax.servlet.ServletException: Error
> > > instantiating
> > > > > > class
> > > > > >
> > > [com.opensymphony.workflow.test.BasicTest(testFoo)]
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.AbstractTestCaller.getTestClassInstance(AbstractTe
> > > s
> > > > > > tCaller.java:309)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.java:
> > > 1
> > > > > > 42)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.AbstractTestController.dispatch79_handleRequest(Ab
> > > s
> > > > > >
> > > >
> > >
> >
>tractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):123)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.AbstractTestController.around79_handleRequest(Abst
> > > r
> > > > > >
> > > >
> > >
> >
>actTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):1147)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.AbstractTestController.handleRequest(AbstractTestC
> > > o
> > > > > >
> > > >
> > >
> > >ntroller.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.dispatch88_doPost(ServletTes
> > > t
> > > > > >
> > > >
> > >
> > >Redirector.java;org/apache/cactus/util/log/LogAspect.java(1k):132)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.around88_doPost(ServletTestR
> > > e
> > > > > >
> > > >
> > >
> > >director.java;org/apache/cactus/util/log/LogAspect.java(1k):1147)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector
> > > .
> > > > > >
> > > >
> > >
> > >java;org/apache/cactus/util/log/LogAspect.java(1k):118)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.dispatch87_doGet(ServletTest
> > > R
> > > > > >
> > > >
> > >
> > >edirector.java;org/apache/cactus/util/log/LogAspect.java(1k):105)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.around87_doGet(ServletTestRe
> > > d
> > > > > >
> > > >
> > >
> > >irector.java;org/apache/cactus/util/log/LogAspect.java(1k):1147)
> > > > > >  at
> > > > > >
> > > >
> > >
> >
>org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.
> > > j
> > > > > >
> > > >
> > >
> > >ava;org/apache/cactus/util/log/LogAspect.java(1k):101)
> > > > > >  at
> > > > > >
> > > >
> > >
> > >javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
> > > > > >  at
> > > > > >
> > > >
> > >
> > >javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
> > > > > >  at
> > > > > >
> > > >
> > >
> > >javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
> > > > > >  at com.evermind._deb._lnc(.:514)
> > > > > >  at com.evermind._deb._wmb(.:170)
> > > > > >  at com.evermind._co._wbb(.:581)
> > > > > >  at com.evermind._co._fs(.:189)
> > > > > >  at com.evermind._bt.run(.:62)
> > > > > > Root cause is; java.lang.ClassCastException:
> > >
> >=== message truncated ===
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Health - your guide to health and wellness
> >http://health.yahoo.com
> >
> >--
> >To unsubscribe, e-mail:
> ><ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
> >
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>