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 Indranil Poddar <in...@tcs.com> on 2007/09/06 07:52:59 UTC

ChainedRuntimeException

Hi,
I am using Websphere Studio Application developer to run Unit tests for my 
web application.
I have incorporated Cactus to do the server side testing.
However, when I run the tests, I get a ChainedRuntimeException. The 
detailed log is given below:

org.apache.cactus.util.ChainedRuntimeException: Failed to get the test 
results at 
[http://localhost:9080/CspLoanAdmin/JSP/Admin/ServletRedirector]
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:131)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:222)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300)
        at 
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
org.apache.cactus.client.ParsingException: Not a valid response [404 Not 
Found]
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.callGetResult(DefaultHttpClient.java:249)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:126)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:222)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300)
        at 
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)

Any help would be appreciated.
Thanks in advance,

Indranil Poddar
ForwardSourceID:NT00000B9E 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: ChainedRuntimeException

Posted by Indranil Poddar <in...@tcs.com>.
Thank you very much!
I changed the cactus.ContextURL  to http://localhost:9080/CspLoanAdmin and 
everything is working fine.
Your suggestions have been very helpful indeed.
Cheers,
Indranil Poddar 





Kazuhito SUGURI <su...@lab.ntt.co.jp> 
09/06/2007 04:55 PM
Please respond to
"Cactus Users List" <ca...@jakarta.apache.org>


To
cactus-user@jakarta.apache.org
cc

Subject
Re: ChainedRuntimeException






Hi,

In article 
<OF...@tcs.com>,
Thu, 6 Sep 2007 12:50:15 +0530,
Indranil Poddar <in...@tcs.com> wrote: 
indranil> Added jars to Java Build path: 
indranil>         cactus-1.5.jar,
indranil>         aspectjrt-1.1.1.jar
indranil>         commons-httpclient-2.0-rc2.jar.

Do you mean WEB-INF/lib of the application contains these jars?
If so, you may also need to add commons-logging and junit jars.
It's depending on the class-path of the application in the server.


indranil> Added the following mappings to my web.xml:
indranil>                 <servlet-name>ServletRedirector</servlet-name>
indranil>                 <servlet-class>
indranil> org.apache.cactus.server.ServletTestRedirector</servlet-class>
indranil> </servlet>
indranil> <servlet>
indranil>                 <servlet-name>ServletTestRunner</servlet-name>
indranil>                 <servlet-class>
indranil> 
org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
indranil> </servlet>
indranil> 
indranil> 
indranil>         <servlet-mapping>
indranil>                 <servlet-name>ServletRedirector</servlet-name>
indranil>                 <url-pattern>/ServletRedirector</url-pattern>
indranil>         </servlet-mapping>
indranil>         <servlet-mapping>
indranil>                 <servlet-name>ServletTestRunner</servlet-name>
indranil>                 <url-pattern>/ServletTestRunner</url-pattern>
indranil>         </servlet-mapping>

It looks good.
Next point to be confirmed is the consistency between
the context-root of the application and cactus.contextURL property.

According to the stack-trace in your previous message,
the cactus.contextURL would be 
http://localhost:9080/CspLoanAdmin/JSP/Admin.
If the application had been deployed as CspLoadAdmin, however,
the cactus.contextURL should be http://localhost:9080/CspLoanAdmin.


BTW, I'm assuming the application had been deployed successfully,
because the server returned 404 instead of 5xx.
Since I have never used WebSphere, it might be a wrong assumption. 
I recommend you to check the fact first :-)

Hope this helps,
----
Kazuhito SUGURI

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org

ForwardSourceID:NT00000BE6 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: ChainedRuntimeException

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi,

In article <OF...@tcs.com>,
Thu, 6 Sep 2007 12:50:15 +0530,
Indranil Poddar <in...@tcs.com> wrote: 
indranil> Added jars to Java Build path: 
indranil>         cactus-1.5.jar,
indranil>         aspectjrt-1.1.1.jar
indranil>         commons-httpclient-2.0-rc2.jar.

Do you mean WEB-INF/lib of the application contains these jars?
If so, you may also need to add commons-logging and junit jars.
It's depending on the class-path of the application in the server.


indranil> Added the following mappings to my web.xml:
indranil>                 <servlet-name>ServletRedirector</servlet-name>
indranil>                 <servlet-class>
indranil> org.apache.cactus.server.ServletTestRedirector</servlet-class>
indranil> </servlet>
indranil> <servlet>
indranil>                 <servlet-name>ServletTestRunner</servlet-name>
indranil>                 <servlet-class>
indranil> org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
indranil> </servlet>
indranil> 
indranil> 
indranil>         <servlet-mapping>
indranil>                 <servlet-name>ServletRedirector</servlet-name>
indranil>                 <url-pattern>/ServletRedirector</url-pattern>
indranil>         </servlet-mapping>
indranil>         <servlet-mapping>
indranil>                 <servlet-name>ServletTestRunner</servlet-name>
indranil>                 <url-pattern>/ServletTestRunner</url-pattern>
indranil>         </servlet-mapping>

It looks good.
Next point to be confirmed is the consistency between
the context-root of the application and cactus.contextURL property.

According to the stack-trace in your previous message,
the cactus.contextURL would be http://localhost:9080/CspLoanAdmin/JSP/Admin.
If the application had been deployed as CspLoadAdmin, however,
the cactus.contextURL should be http://localhost:9080/CspLoanAdmin.


BTW, I'm assuming the application had been deployed successfully,
because the server returned 404 instead of 5xx.
Since I have never used WebSphere, it might be a wrong assumption. 
I recommend you to check the fact first :-)

Hope this helps,
----
Kazuhito SUGURI

Re: ChainedRuntimeException

Posted by Indranil Poddar <in...@tcs.com>.
Thank you Kazuhito for your speedy response.
I have taken the following steps to cactify my web app in Websphere 
Studio:
Added jars to Java Build path: 
        cactus-1.5.jar,
        aspectjrt-1.1.1.jar
        commons-httpclient-2.0-rc2.jar.
Added the following mappings to my web.xml:
                <servlet-name>ServletRedirector</servlet-name>
                <servlet-class>
org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet>
                <servlet-name>ServletTestRunner</servlet-name>
                <servlet-class>
org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
</servlet>


        <servlet-mapping>
                <servlet-name>ServletRedirector</servlet-name>
                <url-pattern>/ServletRedirector</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>ServletTestRunner</servlet-name>
                <url-pattern>/ServletTestRunner</url-pattern>
        </servlet-mapping>

Is this sufficient?. Do I need to go through any additional steps?
Your suggestions would be very helpful.

Thanks,
Indranil Poddar
Tata Consultancy Services
Mailto: indranil.poddar@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
   Business Solutions
   Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: ChainedRuntimeException

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi,

In article <OF...@tcs.com>,
Thu, 6 Sep 2007 11:22:59 +0530,
Indranil Poddar <in...@tcs.com> wrote: 
indranil> I am using Websphere Studio Application developer to run Unit tests for my 
indranil> web application.
indranil> I have incorporated Cactus to do the server side testing.
indranil> However, when I run the tests, I get a ChainedRuntimeException. The 
indranil> detailed log is given below:
indranil> 
indranil.poddar> org.apache.cactus.util.ChainedRuntimeException: Failed to get the test 
indranil> results at 
indranil> [http://localhost:9080/CspLoanAdmin/JSP/Admin/ServletRedirector]
[snip]
indranil> org.apache.cactus.client.ParsingException: Not a valid response [404 Not 
indranil> Found]

Make sure you have deployed the Cactified application to the server
so that the URL of the ServletReditector,
http://localhost:9080/CspLoanAdmin/JSP/Admin/ServletRedirector
is available.

Hope this helps,
----
Kazuhito SUGURI