What harm is caused by java.lang.IllegalStateException: the answer has already been completed

I constantly find myself below the error in my weblogic 10.3 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 full stacktrace

I was wondering what harm this caused if left unsecured? This error was in my application before I joined the team, is it serious enough to qualify as an “immediate fix”?

+6
java-ee jsp weblogic
source share
3 answers

Struts is open source. Just check the RequestProcessor source before line 658 (as indicated by 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 comment: No mapping can be found to process this request . This is the root cause of the problem. But a call to sendError() to display an error message also cannot be completed because the response is already completed. There are apparently two things: failure: there is no mapping and the default work for displaying Struts was incorrectly implemented programmatically.

+10
source share

This means that the application tried to send an HTTP header after sending a response. What harm it does depends on the application.

In most cases, the missing HTTP header can be carried by the browser, but, for example, if you want to specify a special Content-Type , this can become something of a problem.

However, I suggest that you find the root cause of the problem in order to avoid any confusing or "strange" results.

0
source share

It depends on the fact that you pointed to your HttpResponse object and started sending a response (by calling flush (), sendError () or sendRedirect ()), so potentially any additions to the response stream (or headers, etc.) or even the following action (for example, you called flush () and now you call sendError ()), the requested one will be lost.

0
source share

All Articles