jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Setanta Mathews <smath...@ecceleration.ie>
Subject FormAuthentication and Error Code 500
Date Thu, 18 Nov 2004 11:03:53 GMT
Hi All,
 
I've just started using cactus and I am having a problem getting the
FormAuthentication working properly. I searched the web and mailing lists
already and couldn't find a solution.
 
My begin method for my test method "A" looks like:
 
public void beginA(WebRequest theRequest)
{
            theRequest.setRedirectorName("ServletRedirectorSecure");
            FormAuthentication fa = new FormAuthentication("0",
"qUqP5cyxm6YcTAhz05Hph5gvu9M=");
            theRequest.setAuthentication(fa);
}
 
I can confirm that the ServletRedirectorSecure is configured as a secure
resource in my web.xml.
 
The problem I'm having is that I'm getting the following exception on the
client side when I try to run the test with the Cactus ant task (this is
pulled from the XML log generated by the task):
 
org.apache.commons.httpclient.HttpRecoverableException:
org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the
status  line from the response: unable to find line starting with
&quot;HTTP&quot;
            at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
a:1892)
 
 
The HTTP traffic is
 
1 - Cactus Request
 
GET /ServletRedirectorSecure? HTTP/1.1
Content-type: application/x-www-form-urlencoded
User-Agent: Jakarta Commons-HttpClient/2.0rc1
Host: localhost:8889
 
2 - OC4J Response
 
HTTP/1.1 200 OK
Date: Thu, 18 Nov 2004 10:43:46 GMT
Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
Content-Location:
http://localhost:8889/jsp/html/portlet/my_account/j_login.jsp
Set-Cookie: JSESSIONID=b3eabbf09d734b998c79d15602741b8c; Path=/
Connection: Close
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: no-cache
Transfer-Encoding: chunked
 
3 - Cactus Request
 
POST /j_security_check? HTTP/1.1
Content-type: application/x-www-form-urlencoded
User-Agent: Jakarta Commons-HttpClient/2.0rc1
Host: localhost:8889
Cookie: $Version=0; JSESSIONID=b3eabbf09d734b998c79d15602741b8c
Content-Length: 54
 
j_username=0&j_password=qUqP5cyxm6YcTAhz05Hph5gvu9M%3D
 
4 - OC4J Response
 
HTTP/1.1 100 Continue
Server: Oracle9iAS (9.0.3.0.0) Containers for J2EE
Date: Thu, 18 Nov 2004 10:43:47 GMT
 
 
The HTTP traffic would suggest that the authentication has been successful
but cactus doesn't get a response that it expects.
 
Any help would be greatly appreciated,
 
Thanks,
 
Setanta Mathews.
 
 
 
P.S. The full stack trace of the exception is:
 
org.apache.cactus.util.ChainedRuntimeException: Failed to authenticate the
principal
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody10(FormAuthentication.java:383)
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody11$advice(FormAuthentication.java:117)
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate(Form
Authentication.java)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody0(FormAuthentication.java:105)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody1$advice(FormAuthentication.java:117)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure(FormAut
hentication.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:188)
            at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect(HttpClientConnectionHelper.java)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTe
st(DefaultHttpClient.java:162)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody0(DefaultHttpClient.java:80)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody1$advice(DefaultHttpClient.java:188)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(De
faultHttpClient.java)
            at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebT
est(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:188)
            at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest
(HttpProtocolHandler.java)
            at
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCas
eCaller.java:144)
            at
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCact
usTestCase.java:215)
            at
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTest
Case.java:133)
            at
org.apache.cactus.integration.ant.CactusTask.execute(CactusTask.java:166)
org.apache.commons.httpclient.HttpRecoverableException:
org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the
status  line from the response: unable to find line starting with
&quot;HTTP&quot;
            at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
a:1892)
            at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
ava:2536)
            at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:104
7)
            at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:638)
            at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:526)
            at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect_aroundBody0(HttpClientConnectionHelper.java:142)
            at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect_aroundBody1$advice(HttpClientConnectionHelper.java:188)
            at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect(HttpClientConnectionHelper.java)
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody10(FormAuthentication.java:375)
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate_arou
ndBody11$advice(FormAuthentication.java:117)
            at
org.apache.cactus.client.authentication.FormAuthentication.authenticate(Form
Authentication.java)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody0(FormAuthentication.java:105)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure_aroundB
ody1$advice(FormAuthentication.java:117)
            at
org.apache.cactus.client.authentication.FormAuthentication.configure(FormAut
hentication.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:188)
            at
org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.
connect(HttpClientConnectionHelper.java)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTe
st(DefaultHttpClient.java:162)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody0(DefaultHttpClient.java:80)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_ar
oundBody1$advice(DefaultHttpClient.java:188)
            at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(De
faultHttpClient.java)
            at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebT
est(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:188)
            at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest
(HttpProtocolHandler.java)
            at
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCas
eCaller.java:144)
            at
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCact
usTestCase.java:215)
            at
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTest
Case.java:133)
            at
org.apache.cactus.integration.ant.CactusTask.execute(CactusTask.java:166)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message