java.lang.IllegalStateException

coderanch.com | 4 months ago
  1. Speed up your debug routine!

    Automated exception search integrated into your IDE

  2. 0

    I have a big problem after upgrading to Struts 2.1.6. My application works fine when using Struts 2.0.11. After upgrading to Struts 2.1.6, the application keep showing a "Blank Page" randomly (sometimes it happen, and quite often, but no pattern at all) when struts try to redirect to other action. I'm in devMode = false, and the log shows an exception like this: [2009-04-28 16:49:16,374]DEBUG ServletRedirectResult:57 - Redirecting to finalLocation /pages/home.action? Apr 28, 2009 4:49:16 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:108) at com.opensymphony.module.sitemesh.filter.PageResponseWrapper.sendError(PageResponseWrapper.java:176) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:725) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:127) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:65) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509) at java.lang.Thread.run(Unknown Source) [2009-04-28 16:49:16,376]DEBUG DisposableBeanAdapter:203 - Invoking destroy method 'close' on bean with name 'hibernateSession' [2009-04-28 16:49:16,376]DEBUG HibernateSession:60 - closing hibernateSession [2009-04-28 16:49:16,376]DEBUG RequestContextListener:89 - Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1eb2473 Apr 28, 2009 4:49:16 PM org.apache.catalina.core.StandardHostValve custom SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp] java.lang.IllegalStateException at org.apache.coyote.Response.reset(Response.java:297) at org.apache.catalina.connector.Response.reset(Response.java:658) at org.apache.catalina.connector.Response.reset(Response.java:925) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:417) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:271) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509) at java.lang.Thread.run(Unknown Source) I have made a little adjustment due to an issue in Sitemesh 2.3 PageFilter, you can see the issue here: http://jira.opensymphony.com/browse/SIM-151 To fix the sitemesh issue, I have to make a replacement class for default PageFilter (because struts 2 doesn't support latest Sitemesh 2.4.1), and remove the code "request.getSession(true);". The "blank page" I said previously is happening before and after I have created a new PageFilter, so the changes I've made wont be a matter. In the test case, I try to login and log out repeatedly, and a blank page keep shows up (randomly) when try to redirect form login.action to home.action. the web.xml settings: <filter> <filter-name>struts2-prepare</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class> </filter> <filter> <filter-name>velocity</filter-name> <filter-class>org.apache.struts2.sitemesh.VelocityPageFilter</filter-class> </filter> <filter> <filter-name>struts2-execute</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2-prepare</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>velocity</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2-execute</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> The login and logout action XML: <action name="login" class="com.cpssoft.action.menus.general.LoginAction"> <interceptor-ref name="defaultStack" /> <interceptor-ref name="language" /> <result name="input" type="velocity">/pages/general/login.vm</result> <result name="success" type="redirect"> ${originalUrl}</result> </action> <action name="logout" class="com.cpssoft.action.menus.general.LoginAction" method="logout"> <interceptor-ref name="defaultStack" /> <interceptor-ref name="language" /> <result name="input" type="velocity">/pages/general/login.vm</result> </action> ${originalUrl} will be filled with: "/pages/home.action" (See the exception above). Any Idea how to fix this issue? Thx a lot

    Apache's JIRA Issue Tracker | 8 years ago | Yoseph Stephen
    java.lang.IllegalStateException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      No message provided

      at org.apache.coyote.Response.reset()
    2. Grizzly HTTP
      Response.reset
      1. org.apache.coyote.Response.reset(Response.java:297)
      1 frame
    3. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.connector.Response.reset(Response.java:658)
      2. org.apache.catalina.connector.Response.reset(Response.java:925)
      3. org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:417)
      4. org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:271)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      8 frames
    4. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      3 frames
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame