ZK

error-page in JBoss causes IllegalStateException

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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 added a comment - 18/May/12 9:09 AM

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 added a comment - 18/May/12 9:09 AM 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 added a comment - 21/May/12 10:25 AM

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 added a comment - 21/May/12 10:25 AM 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 added a comment - 22/May/12 2:11 AM

Bug fixed since 05/22/2012

Show
jumperchen added a comment - 22/May/12 2:11 AM Bug fixed since 05/22/2012

People

Vote (0)
Watch (0)

Dates

  • Created:
    18/May/12 9:05 AM
    Updated:
    22/May/12 2:11 AM
    Resolved:
    22/May/12 2:11 AM