Re: ChainedRuntimeException

2007-09-06 Thread Kazuhito SUGURI
Hi,

In article [EMAIL PROTECTED],
Thu, 6 Sep 2007 11:22:59 +0530,
Indranil Poddar [EMAIL PROTECTED] 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

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



Re: ChainedRuntimeException

2007-09-06 Thread Indranil Poddar
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-nameServletRedirector/servlet-name
servlet-class
org.apache.cactus.server.ServletTestRedirector/servlet-class
/servlet
servlet
servlet-nameServletTestRunner/servlet-name
servlet-class
org.apache.cactus.server.runner.ServletTestRunner/servlet-class
/servlet


servlet-mapping
servlet-nameServletRedirector/servlet-name
url-pattern/ServletRedirector/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameServletTestRunner/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: [EMAIL PROTECTED]
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

2007-09-06 Thread Kazuhito SUGURI
Hi,

In article [EMAIL PROTECTED],
Thu, 6 Sep 2007 12:50:15 +0530,
Indranil Poddar [EMAIL PROTECTED] 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-nameServletRedirector/servlet-name
indranil servlet-class
indranil org.apache.cactus.server.ServletTestRedirector/servlet-class
indranil /servlet
indranil servlet
indranil servlet-nameServletTestRunner/servlet-name
indranil servlet-class
indranil org.apache.cactus.server.runner.ServletTestRunner/servlet-class
indranil /servlet
indranil 
indranil 
indranil servlet-mapping
indranil servlet-nameServletRedirector/servlet-name
indranil url-pattern/ServletRedirector/url-pattern
indranil /servlet-mapping
indranil servlet-mapping
indranil servlet-nameServletTestRunner/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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ChainedRuntimeException

2007-09-06 Thread Indranil Poddar
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 [EMAIL PROTECTED] 
09/06/2007 04:55 PM
Please respond to
Cactus Users List cactus-user@jakarta.apache.org


To
cactus-user@jakarta.apache.org
cc

Subject
Re: ChainedRuntimeException






Hi,

In article 
[EMAIL PROTECTED],
Thu, 6 Sep 2007 12:50:15 +0530,
Indranil Poddar [EMAIL PROTECTED] 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-nameServletRedirector/servlet-name
indranil servlet-class
indranil org.apache.cactus.server.ServletTestRedirector/servlet-class
indranil /servlet
indranil servlet
indranil servlet-nameServletTestRunner/servlet-name
indranil servlet-class
indranil 
org.apache.cactus.server.runner.ServletTestRunner/servlet-class
indranil /servlet
indranil 
indranil 
indranil servlet-mapping
indranil servlet-nameServletRedirector/servlet-name
indranil url-pattern/ServletRedirector/url-pattern
indranil /servlet-mapping
indranil servlet-mapping
indranil servlet-nameServletTestRunner/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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

ForwardSourceID:NT0BE6 
=-=-=
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

2007-05-09 Thread Min Edwards
Check your cactus.properties file and make sure you have the servlet redirect 
to matches this:  http://localhost:8080/javaWebAppSec/ServletRedirector

If that is not the issue, make sure you have the ear file deployed correctly in 
your application server. 
I saw this problem once because the cactus test was running against the wrong 
ear file deployed.




Cody, John T [EMAIL PROTECTED] wrote: I'm getting a ChainedRuntimeException 
when I try to run my tests.  My application uses forms based authentication, 
and I know that the authentication piece is working and the error message says 
that it can't connect to the secured redirector.  Below is all the code that I 
can think of that might be relevant.  Any help you can provide would be great.

Thanks
john

Below is my ServletTestCase

package controller;
import java.util.ArrayList;

import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
import org.apache.cactus.client.authentication.FormAuthentication;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class SesServletTestStuActions extends ServletTestCase {
 private int testCtr = 0;
 private static ArrayList actions = new ArrayList();

 public void begin(WebRequest request) throws Exception {
  actions.add(index);
  actions.add(listClasses);
  actions.add(courseDetail);
  actions.add(listCourses);
  actions.add(logout);
  
  // This is the only action a student can't do.
  actions.add(listEntities);
  
//  We only need to authenticate the user once, for each ServletTestCase
  request.setAuthentication(new FormAuthentication([EMAIL PROTECTED]  , 
testStu)); 
  request.addParameter(action, actions.get(testCtr));

 }

 public void end(WebRequest request) throws Exception {
  actions = null;
  testCtr++;
 }
 
 // Testing actions that a student can do
 @Test
 public void testUserHasPermission1() throws Exception {
  SesServlet sesServlet = new SesServlet();
  assertTrue(The user can NOT perform this action, 
sesServlet.userHasPermission(request));
  
 }

}

Part of my web.xml where I'm defining the servlet mappings for the redirectors:

 
 ServletRedirector 
 org.apache.cactus.server.ServletTestRedirector 
 
 
 ServletRedirector 
 /ServletRedirector 



 ServletRedirectorSecure
 org.apache.cactus.server.ServletTestRedirector


 ServletRedirectorSecure
 /ServletRedirectorSecure



 ServletTestRunner
 
 org.apache.cactus.server.runner.ServletTestRunner
 



 ServletTestRunner
 /ServletTestRunner


Results/Stacktrac below:


−
 
−
 
−
 
org.apache.cactus.util.ChainedRuntimeException: Failed to connect to the 
secured redirector: http://localhost:8080/javaWebAppSec/ServletRedirector
 at 
org.apache.cactus.client.authentication.FormAuthentication.getSecureSessionIdCookie(FormAuthentication.java:315)
 at 
org.apache.cactus.client.authentication.FormAuthentication.authenticate_aroundBody10(FormAuthentication.java:354)
 at 
org.apache.cactus.client.authentication.FormAuthentication.authenticate_aroundBody11$advice(FormAuthentication.java:217)
 at 
org.apache.cactus.client.authentication.FormAuthentication.authenticate(FormAuthentication.java)
 at 
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundBody0(FormAuthentication.java:105)
 at 
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundBody1$advice(FormAuthentication.java:217)
 at 
org.apache.cactus.client.authentication.FormAuthentication.configure(FormAuthentication.java)
 at 
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHelper.java:103)
 at 
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConnectionHelper.java:288)
 at 
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:162)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:288)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:288)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java)
 at 
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144)
 at 

Re: ChainedRuntimeException: Failed to get the test results at http:...//ServletRedirector

2005-09-18 Thread Kazuhito SUGURI
Hi Phlip,

In article [EMAIL PROTECTED],
Fri, 16 Sep 2005 12:07:50 -0700,
Phlip [EMAIL PROTECTED] wrote: 
phlip2005 compile-test:
phlip2005 log4j:ERROR setFile(null,false) call failed.
phlip2005 java.io.FileNotFoundException: @[EMAIL PROTECTED] (The
phlip2005 system cannot find the path specified)

You (your build system) should rewrite @target.dir@ properly.


phlip2005  phlip2005 Then it doesn't say where to put the files. I use the 
Tomcat bundled
phlip2005  phlip2005 with NetBeans, and there is another Tomcat available.
phlip2005  phlip2005 
phlip2005  phlip2005 Please don't just say on the class path. Where do 
those files go?
phlip2005  
phlip2005  How about WEB-INF/classes?
phlip2005 
phlip2005 build/web/WEB-INF/classes or ? ;-)

It's depending on your build system.
Finally siginificant is a cactified application deployed to your server
even if the source is where.
The files should exist on your server-side classpath
and WEB-INF/classes of your cactified application is one of them.

I've never userd NetBeans. So, please don't ask me how ;-)

Kazuhito SUGURI

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



Re: ChainedRuntimeException: Failed to get the test results at http:...//ServletRedirector

2005-09-16 Thread Kazuhito SUGURI
Hi Phlip,

In article [EMAIL PROTECTED],
Wed, 14 Sep 2005 14:24:12 -0700,
Phlip [EMAIL PROTECTED] wrote: 
phlip2005 
testSuccessfulLogin(TestLoginAction)org.apache.cactus.util.ChainedRuntimeException:
phlip2005 Failed to get the test results at
phlip2005 [http://localhost:8084/StrutsTest//ServletRedirector]

'//' in the URL may be the cause.
Could you verify that your contextURL is not ends with '/'?


phlip2005 Then it doesn't say where to put the files. I use the Tomcat bundled
phlip2005 with NetBeans, and there is another Tomcat available.
phlip2005 
phlip2005 Please don't just say on the class path. Where do those files go?

How about WEB-INF/classes?

Hope this helps,

Kazuhito SUGURI

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



Re: ChainedRuntimeException: Failed to get the test results at http:...//ServletRedirector

2005-09-16 Thread Phlip
Kazuhito SUGURI wrote:

 phlip2005 [http://localhost:8084/StrutsTest//ServletRedirector]
 
 '//' in the URL may be the cause.
 Could you verify that your contextURL is not ends with '/'?

Thanks that was it! The cactus.properties file has a cactus.contextURL
line that should not have a trailing /

(Until now I was unaware that web servers don't follow the rule that
file servers do, a double slash, //, is accepted as a convenience for
scripts that glue paths. Web servers don't allow that.)

Could someone convert this thread to a page on
http://wiki.apache.org/jakarta-cactus/ , so Google-PhDs like me don't
get confused again?

Now we have THIS problem:

compile-test:
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: @[EMAIL PROTECTED] (The
system cannot find the path specified)
...
There were 2 errors:
1) 
testSuccessfulLogin(TestLoginAction)org.apache.cactus.util.ChainedRuntimeException:
Failed to get the test results at
[http://localhost:8084/StrutsTest/ServletRedirector]

So it seems that my feeb attempt to turn on the log4j system has failed.

Please don't tell me to read
http://jakarta.apache.org/cactus/integration/manual/howto_config.html#logging
- that's what caused this error. I don't understand what folders to
put those log4j.properties files in, for NetBeans.

 phlip2005 Then it doesn't say where to put the files. I use the Tomcat 
 bundled
 phlip2005 with NetBeans, and there is another Tomcat available.
 phlip2005 
 phlip2005 Please don't just say on the class path. Where do those files go?
 
 How about WEB-INF/classes?

build/web/WEB-INF/classes or ? ;-)

-- 
  Phlip
  http://www.greencheese.org/ZeekLand  -- NOT a blog!!

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



RE: ChainedRuntimeException with Struts and Cactus

2003-12-05 Thread Vincent Massol
Hi David,

In order to help you further, I would need you to enable cactus logging
and send us the client and server logs.

Thanks
-Vincent

 -Original Message-
 From: David Stemm [mailto:[EMAIL PROTECTED]
 Sent: 05 December 2003 18:51
 To: [EMAIL PROTECTED]
 Subject: ChainedRuntimeException with Struts and Cactus
 
 All,
I'm trying to incorporate Cactus 1.5 into my Struts 1.1 application
 using Tomcat 4.1.29.  I configured the Cactus samples to run through
my
 Ant script and everything works fine and all the tests run
successfully.
 When I simply add the commons-*.jar files needed for struts I get the
 ChainedRuntimeException (full error below) when I run my Ant script.
So I
 tried adding the jars 1 at a time and then run my Ant script.  The
tests
 run OK until I add the commons-digester.jar which then causes it to
fail.
 Has anybody seen this before or have a work-around?  Has anybody
 configured Cactus to work with Struts?  Any help would be appreciated.
 Thanks.
 
 David Stemm
 
 Error Message:
 [cactus] Testcase:
 testOut(org.apache.cactus.sample.unit.TestJspOut):Caused an ERROR
 [cactus] Failed to get the test results at
[http://localhost:8081/stemm-
 cactified/JspRedirector]
 [cactus] org.apache.cactus.util.ChainedRuntimeException: Failed to get
the
 test results at [http://localhost:8081/stemm-cactified/JspRedirector]
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundB
od
 y0(DefaultHttpClient.java:131)
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundB
od
 y1$advice(DefaultHttpClient.java:240)
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(Default
Ht
 tpClient.java)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(W
eb
 ClientTestCaseDelegate.java:333)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTe
st
 (WebClientTestCaseDelegate.java:281)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebC
li
 entTestCaseDelegate.java:257)
 [cactus] at

org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300
)
 [cactus] at
 org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)
 [cactus] org.apache.cactus.client.ParsingException: Not a valid
response
 [500 Internal Server Error]
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.callGetResult(
De
 faultHttpClient.java:249)
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundB
od
 y0(DefaultHttpClient.java:126)
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundB
od
 y1$advice(DefaultHttpClient.java:240)
 [cactus] at

org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(Default
Ht
 tpClient.java)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(W
eb
 ClientTestCaseDelegate.java:333)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTe
st
 (WebClientTestCaseDelegate.java:281)
 [cactus] at

org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebC
li
 entTestCaseDelegate.java:257)
 [cactus] at

org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300
)
 [cactus] at
 org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)


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