tags:

views:

691

answers:

3

I continuously get below error on my weblogic 10.3 console logs

java.lang.IllegalStateException: Response already committed
at weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:
1462)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:601)
at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:658)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:193)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)

Truncated. see log file for complete stacktrace

I was wondering what harm is caused by this if left unfixed ? This error has been in my app before I joined the team, is this serious enough to qualify as "Needs immediate fix" ?

A: 

It means that the application tried to send an HTTP header after the response has been sent. What kind of harm this does depends on the application.

Most of the time a missing HTTP header can be tolerated by the browser but, for example, if you want to specify a special Content-Type this might become something of a problem.

Nevertheless I suggest you find the root cause of the problem to avoid any confusing or "strange" results.

perdian
A: 

It depends, the meaning of the error is that you have written to your HttpResponse object and started to send the response (by calling flush(), sendError() or sendRedirect()) so potentially any additions to the response stream (or headers etc) or indeed the subsequent action (for example, you called flush() and now you're calling sendError()) requested will be lost.

fd
Pardon my inexperience but I am not getting it clearly. Our struts app has some DispatchAction class where the business logic is executed by claling appropriate BusinessDeleegators, once everything is fine the method returns by calling findForward on ActionMapping instance. Do you see a problem here..?
Ravi Gupta
Not unless your business logic sends messages to your response object. I'm not too familiar with struts specifically so I can't really make an intelligent response at that level, all I can say is in my experience with basic servlets I have seen this error by "committing" the response object more than once. Sorry I can't be of more help.
fd
+3  A: 

Struts is open source. Just check the RequestProcessor source prior to line 658 (as noted in stacktrace):

// No mapping can be found to process this request
String msg = getInternal().getMessage("processInvalid", path);
log.error(msg);
response.sendError(HttpServletResponse.SC_NOT_FOUND, msg);

See the comment: No mapping can be found to process this request. That's the root cause of the problem. But the sendError() call to display an error message cannot be completed as well, because the response is already committed. Apparently there are two things a failure: there's a mapping missing and the default work of Struts mapping has been taken over programmatically in an incorrect manner.

BalusC
(+1) looking at libraries source code is in my opinion the best way to quickly debug framework-dependent issues.
Bozho