Vincent,
Now that I've resolved parameter issue with the servlet, I've another issue.
When I try & call Cactus servlet 1st time, it works fine. But when I call it
the 2nd tim e (again thru Jmeter), I get NullPointerException ::
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:389)
at
weblogic.servlet.internal.WebAppServletContext.setAttribute(WebAppServletContext.java:669)
at
org.apache.cactus.server.AbstractServletContextWrapper.dispatch69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):126)
at
org.apache.cactus.server.AbstractServletContextWrapper.around69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
at
org.apache.cactus.server.AbstractServletContextWrapper.setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):124)
at
org.apache.cactus.server.AbstractServletContextWrapper.dispatch69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):126)
at
org.apache.cactus.server.AbstractServletContextWrapper.around69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
at
org.apache.cactus.server.AbstractServletContextWrapper.setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):124)
at
org.apache.cactus.server.AbstractServletContextWrapper.dispatch69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):126)
at
org.apache.cactus.server.AbstractServletContextWrapper.around69_setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
at
org.apache.cactus.server.AbstractServletContextWrapper.setAttribute(AbstractServletContextWrapper.java;org/apache/cactus/util/log/LogAspect.aj(1k):124)
at
servletunit.struts.CactusStrutsTestCase.getActionServlet(CactusStrutsTestCase.java:400)
Looking at the exception above it appears to me that the context didn't get
initialized or may be I'm missing something in the tearDown().
Here are my setup() & tearDown() methods::
public void tearDown() throws Exception {
System.out.println("\n\n ******* Inside tearDown() method of
RunQueryActionTest.before calling super.tearDown()");
super.tearDown();
}
public void setUp() throws Exception {
System.out.println("\n\n ******* Inside setUp() method of
RunQueryActionTest before calling super.setUp()");
super.setUp();
setInitParameter("config", "query/config/struts-config.xml");
setInitParameter("application", "AppResources");
}
Any clues as to what I might be missing?
Any help / pointers is appreciated.
Regards,
Sanket Desai
-----Original Message-----
From: Vincent Massol [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 22, 2004 4:12 PM
To: 'Cactus Users List'
Subject: RE: Passing argument to Cactus using servlet
Hi Sankeet,
> -----Original Message-----
> From: Sanket Desai [mailto:[EMAIL PROTECTED]
> Sent: mercredi 22 d�cembre 2004 21:31
> To: [email protected]
> Subject: Passing argument to Cactus using servlet
>
> Hi there,
>
> I'm calling onto cactus using JMeter.
>
> Basically calling "ServletTestRunner" servlet while passing
> 1) suite="Fully_Qualified_TestSuiteName"
> 2) myArg=myValue
>
>
> I see that the test gets called but I need to access my passed
> argument
> (myArg) in my test class that I passed from JMeter. Unfortunately that
> parameter is not available.I guess the "request" parameter that we
> have using "getRequest()" method of "CactusStrutsTestCase" or "public
> request variable" of ServletTestCase is actually provided by Cactus itself.
>
No, that should work fine. The "request" object that you're getting is the real
request object. To my knowledge, we have several tests in the Cactus test suite
that pass HTTP parameters to the server side.
Ah, I can think of only possible reason why it wouldn't work: maybe
StrutsTestCase does not pass the original request? I have never used
strutstestcase so I don't know but try without strutstestcase as a test and it
should work fine. You can ask on the strutstestcase mailing list. Maybe they'll
be able to help?
> Does anyone know a way of retrieving the passed request parameter to
> cactus in the test class?
>
> I really apreciate any help / pointers in this scenario.
>
> Thanking you in advance.
>
> Regards,
>
> Sanket Desai
>
---------------------------------------------------------------------
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]