Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1144

error-page in JBoss causes IllegalStateException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11, 6.0.1
    • Fix Version/s: 6.0.2, 5.0.12
    • Component/s: ZK Loader, ZK Update Engine
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      JBoss 5.1 ZK5.0.11/ZK6.0.1

      Description

      Use error-page in both web.xml and zk.xml

      	<error-page>
      		<exception-type>java.lang.Throwable</exception-type>
      		<location>/WEB-INF/sys/error.zul</location>
      	</error-page>
      

      Put below error.zul in WEB-INF/sys folder.

      <zk>
      	<window
      		title="Error ${requestScope['javax.servlet.error.status_code']}"
      		width="400px" border="normal" mode="modal" closable="true">
      		<vbox>
      			KillerApp encounters an error:
      			${requestScope['javax.servlet.error.message']}
      			<hbox style="margin-left:auto; margin-right:auto">
      				<button label="Continue" onClick="spaceOwner.detach()" />
      				<button label="Reload"
      					onClick="Executions.sendRedirect(null)" />
      			</hbox>
      		</vbox>
      	</window>
      </zk>
      

      index.zul

      <?page title="index page" contentType="text/html;charset=UTF-8"?>
      <zk xmlns:n="native" xmlns:h="xhtml" xmlns:zk="zk" xmlns:w="client">
      	<window width="100%" height="100%" border="normal" mode="modal">
      		<button label="Cause Error"
      			onClick='throw new NullPointerException("Unknown Value")' />
      		<separator spacing="10px" />
      	</window>
      </zk>
      

      Click "Cause error"
      Expected: Error page is displayed and only the stack trace by error thrown by app is displayed on server console.
      Actual: Error page is displayed a sexpected but in addition to original error stack trace following stack trace is printed on server console
      10:13:32,588 ERROR [it]] Exception Processing ErrorPage[exceptionType=java.lang.Throwable, location=/WEB-INF/sys/error.zul]
      java.lang.IllegalStateException: Cannot reset buffer after response has been committed
      at org.apache.catalina.connector.Response.resetBuffer(Response.java:686)
      at org.apache.catalina.connector.Response.resetBuffer(Response.java:707)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:409)
      at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:270)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        ashishd ashishd added a comment -

        Note that if you remove the web.xml error-page config IllegalStateException is not thrown so this issue is more specific to "Error handling when serving Au requests" Refer here http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/UI%20Patterns/Error%20Handling

        Show
        ashishd ashishd added a comment - Note that if you remove the web.xml error-page config IllegalStateException is not thrown so this issue is more specific to "Error handling when serving Au requests" Refer here http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/UI%20Patterns/Error%20Handling
        Hide
        jumperchen jumperchen added a comment -

        There is the workaround for this issue, you can remove the "javax.servlet.error.exception" in the error.zul page.
        For example,

        <zscript>
        execution.removeAttribute("javax.servlet.error.exception");
        </zscript>
        
        Show
        jumperchen jumperchen added a comment - There is the workaround for this issue, you can remove the "javax.servlet.error.exception" in the error.zul page. For example, <zscript> execution.removeAttribute( "javax.servlet.error.exception" ); </zscript>
        Hide
        jumperchen jumperchen added a comment -

        Bug fixed since 05/22/2012

        Show
        jumperchen jumperchen added a comment - Bug fixed since 05/22/2012

          People

          • Assignee:
            jumperchen jumperchen
            Reporter:
            ashishd ashishd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: