Re: [OT] sslext java.lang.IllegalStateException: sendError() failed- data has already been sent to client

2003-08-31 Thread Adam Hardy
Hi Robert
you seem to be fairly confident of the circumstances so I would suggest, 
barring any other response on this list (I'm sorry but I don't know 
enough to help any further), that you log this in bugzilla and / or post 
it to the struts-dev list.

Good luck,
Adam
On 08/30/2003 07:03 PM Robert Taylor wrote:
Adam, thanks for the reply but upgrading won't help in this case.
I've already looked at the source for the full 1.1 release and this
issue is not addressed.
Also, I'm not using Tomcat, I'm using ServletExec4.2 with the latest patch.
The servlet container has nothing to do with this problem.
It is fairly evident that the problem is that the response is being written
to after it has been committed. I've suggested a workaround and might
implement it.
I just wanted to know if this issue has been addressed.

I don't necessarily think it is the responsibility of the RequestProcessor
to check to see if the response has already been committed before writing to
it,
but as more and more plugin's are added (TilesRequestProcessor,
SecureRequestProcessor, etc...)
it may become necessary to check for this condition.
If I'm missing something obvious, please let me know.

robert




-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 30, 2003 9:45 AM
To: Struts Users Mailing List
Subject: Re: [OT] sslext java.lang.IllegalStateException: sendError()
failed - data has already been sent to client
It might sound like Microsoft Support Hotline, but you should upgrade to
the full 1.1 release. Plus of interest would be the tomcat version.
On 08/29/2003 11:22 PM Robert Taylor wrote:

I'm using Struts1.1rc2 with sslext for Struts1.1rc2 and am seeing some
peculiar behavior
when an invalid path is requested.
What should happen is the RequestProcessor.processMapping()
should recognize

that
there is no action mapping for the path, log a message, and send an 400
(Invalid Request) response
directly back to the client.
That's what is happening here.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
But what happens is that SecureRequestProcess.preProcess() invokes
RequestProcessor.processMapping()
which logs the above error message, then returns null.
SecureRequestProcessor then returns true because
no mapping was found. Then RequestProcessor invokes its own
processMapping()

which is when the
IllegalStateException is thrown because the response has already been
committed.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
10156: ServletExec: caught exception - java.lang.IllegalStateException:
sendError() failed - data has already
been sent to client
10156: java.lang.IllegalStateException: sendError() failed - data has
already been sent to client
10156:  at
com.newatlanta.servletexec.Response.sendError(Response.java:670)

10156:  at

org.apache.struts.action.RequestProcessor.processMapping(RequestPr
ocessor.ja
va:679)
10156:  at
org.apache.struts.action.RequestProcessor.process(RequestProcessor
.java:242)
10156:  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1421)
10156:  at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:500)
10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10156:  at
com.newatlanta.servletexec.ServletExec.CallServletService(ServletE
xec.java:1
679)
10156:  at
com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERe
questDispa
tcher.java:280)
10156:  at
com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDi
spatcher.j
ava:191)
10156:  at
com.newatlanta.servletexec.ApplicationInfo.processApplRequest(Appl
icationInf
o.java:1447)
10156:  at
com.newatlanta.servletexec.ServerHostInfo.processApplRequest(Serve
rHostInfo.
java:1242)
10156:  at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.
java:1235)
10156:  at

com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.
java:1113)
I'm assuming that this exception is trapped, because I get the
expected page

back in the browser.
Should I be worried about this? One possible work around would
be to check

to see if the
response has already been commited before attempting to write
to it. I'm not

sure how that would
impact the rest of the logic in the RequestProcessor.
robert

PS. I've created a test web app which duplicates the behavior described
above. If I remove
controller
processorClass=org.apache.struts.action.SecureRequestProcessor/ from
struts-config.xml
then I don't see the exception stack trace.
BTW: Below is a snippet of code from RequestProcessor where the
exception is

being thrown:

snip
// No mapping can be found to process this request
log.error(getInternal().getMessage(processInvalid, path));
response.sendError(HttpServletResponse.SC_BAD_REQUEST,   //
= Here

Re: [OT] sslext java.lang.IllegalStateException: sendError() failed- data has already been sent to client

2003-08-30 Thread Adam Hardy
It might sound like Microsoft Support Hotline, but you should upgrade to 
the full 1.1 release. Plus of interest would be the tomcat version.

On 08/29/2003 11:22 PM Robert Taylor wrote:
I'm using Struts1.1rc2 with sslext for Struts1.1rc2 and am seeing some
peculiar behavior
when an invalid path is requested.
What should happen is the RequestProcessor.processMapping() should recognize
that
there is no action mapping for the path, log a message, and send an 400
(Invalid Request) response
directly back to the client.
That's what is happening here.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
But what happens is that SecureRequestProcess.preProcess() invokes
RequestProcessor.processMapping()
which logs the above error message, then returns null.
SecureRequestProcessor then returns true because
no mapping was found. Then RequestProcessor invokes its own processMapping()
which is when the
IllegalStateException is thrown because the response has already been
committed.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
10156: ServletExec: caught exception - java.lang.IllegalStateException:
sendError() failed - data has already
 been sent to client
10156: java.lang.IllegalStateException: sendError() failed - data has
already been sent to client
10156:  at com.newatlanta.servletexec.Response.sendError(Response.java:670)
10156:  at
org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.ja
va:679)
10156:  at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:242)
10156:  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1421)
10156:  at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:500)
10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10156:  at
com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1
679)
10156:  at
com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispa
tcher.java:280)
10156:  at
com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j
ava:191)
10156:  at
com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInf
o.java:1447)
10156:  at
com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo.
java:1242)
10156:  at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1235)
10156:  at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113)
I'm assuming that this exception is trapped, because I get the expected page
back in the browser.
Should I be worried about this? One possible work around would be to check
to see if the
response has already been commited before attempting to write to it. I'm not
sure how that would
impact the rest of the logic in the RequestProcessor.
robert

PS. I've created a test web app which duplicates the behavior described
above. If I remove
controller
processorClass=org.apache.struts.action.SecureRequestProcessor/ from
struts-config.xml
then I don't see the exception stack trace.
BTW: Below is a snippet of code from RequestProcessor where the exception is
being thrown:
snip
// No mapping can be found to process this request
log.error(getInternal().getMessage(processInvalid, path));
response.sendError(HttpServletResponse.SC_BAD_REQUEST,   // = Here
getInternal().getMessage(processInvalid, path));
/snip


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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] sslext java.lang.IllegalStateException: sendError() failed - data has already been sent to client

2003-08-30 Thread Robert Taylor
Adam, thanks for the reply but upgrading won't help in this case.
I've already looked at the source for the full 1.1 release and this
issue is not addressed.

Also, I'm not using Tomcat, I'm using ServletExec4.2 with the latest patch.
The servlet container has nothing to do with this problem.

It is fairly evident that the problem is that the response is being written
to after it has been committed. I've suggested a workaround and might
implement it.

I just wanted to know if this issue has been addressed.

I don't necessarily think it is the responsibility of the RequestProcessor
to check to see if the response has already been committed before writing to
it,
but as more and more plugin's are added (TilesRequestProcessor,
SecureRequestProcessor, etc...)
it may become necessary to check for this condition.


If I'm missing something obvious, please let me know.

robert



 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 30, 2003 9:45 AM
 To: Struts Users Mailing List
 Subject: Re: [OT] sslext java.lang.IllegalStateException: sendError()
 failed - data has already been sent to client


 It might sound like Microsoft Support Hotline, but you should upgrade to
 the full 1.1 release. Plus of interest would be the tomcat version.

 On 08/29/2003 11:22 PM Robert Taylor wrote:
  I'm using Struts1.1rc2 with sslext for Struts1.1rc2 and am seeing some
  peculiar behavior
  when an invalid path is requested.
 
  What should happen is the RequestProcessor.processMapping()
 should recognize
  that
  there is no action mapping for the path, log a message, and send an 400
  (Invalid Request) response
  directly back to the client.
 
  That's what is happening here.
  10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
  processMapping
  SEVERE: Invalid path /something was requested
 
 
  But what happens is that SecureRequestProcess.preProcess() invokes
  RequestProcessor.processMapping()
  which logs the above error message, then returns null.
  SecureRequestProcessor then returns true because
  no mapping was found. Then RequestProcessor invokes its own
 processMapping()
  which is when the
  IllegalStateException is thrown because the response has already been
  committed.
 
  10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
  processMapping
  SEVERE: Invalid path /something was requested
  10156: ServletExec: caught exception - java.lang.IllegalStateException:
  sendError() failed - data has already
   been sent to client
  10156: java.lang.IllegalStateException: sendError() failed - data has
  already been sent to client
  10156:  at
 com.newatlanta.servletexec.Response.sendError(Response.java:670)
  10156:  at
 
 org.apache.struts.action.RequestProcessor.processMapping(RequestPr
 ocessor.ja
  va:679)
  10156:  at
 
 org.apache.struts.action.RequestProcessor.process(RequestProcessor
 .java:242)
  10156:  at
  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1421)
  10156:  at
  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:500)
  10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  10156:  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  10156:  at
 
 com.newatlanta.servletexec.ServletExec.CallServletService(ServletE
 xec.java:1
  679)
  10156:  at
 
 com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERe
 questDispa
  tcher.java:280)
  10156:  at
 
 com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDi
 spatcher.j
  ava:191)
  10156:  at
 
 com.newatlanta.servletexec.ApplicationInfo.processApplRequest(Appl
 icationInf
  o.java:1447)
  10156:  at
 
 com.newatlanta.servletexec.ServerHostInfo.processApplRequest(Serve
 rHostInfo.
  java:1242)
  10156:  at
 
 com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.
 java:1235)
  10156:  at
 
 com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.
 java:1113)
 
 
  I'm assuming that this exception is trapped, because I get the
 expected page
  back in the browser.
  Should I be worried about this? One possible work around would
 be to check
  to see if the
  response has already been commited before attempting to write
 to it. I'm not
  sure how that would
  impact the rest of the logic in the RequestProcessor.
 
  robert
 
  PS. I've created a test web app which duplicates the behavior described
  above. If I remove
  controller
  processorClass=org.apache.struts.action.SecureRequestProcessor/ from
  struts-config.xml
  then I don't see the exception stack trace.
 
  BTW: Below is a snippet of code from RequestProcessor where the
 exception is
  being thrown:
 
  snip
  // No mapping can be found to process this request
  log.error(getInternal().getMessage(processInvalid, path));
  response.sendError(HttpServletResponse.SC_BAD_REQUEST,   //
 = Here
  getInternal().getMessage(processInvalid, path));
  /snip