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

error-page in JBoss causes IllegalStateException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 6.0.2, 5.0.12
    • 5.0.11, 6.0.1
    • ZK Loader, ZK Update Engine
    • Security Level: Jimmy
    • None
    • JBoss 5.1 ZK5.0.11/ZK6.0.1

    • None

      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)

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

              Created:
              Updated:
              Resolved: