Crash on thrown exception on Orion

Guillaume Boudreau <[email protected]> Mon, 16 May 2005 13:49:45 CDT
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <9678099.1116270028413.JavaMail.os-j2ee@opensymphony01.contegix.com>
Short version: Orion crashes when it reaches the first <decorator:***/> tag in my decorator page (a JSP decorator) when an exception is thrown by some code and the <%@ page errorPage="..."%> attribute is used.

Long version:

TestErrorPage.jsp:

<%@ page errorPage="MyErrorPage.jsp" %>
<HTML>
<HEAD><TITLE>Test Error Page</TITLE></HEAD>
<BODY>
<H2>Throw Exception!</H2>
<% String nullString = null; %>
<% nullString.length(); %>
</BODY>
</HTML>

MyErrorPage.jsp:

<%@ page isErrorPage="true" %>
<html>
<head>
    <title>My Error Page</title>
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
</head>
<body>
<h2>Exception Information</h2>
<table>

<tr>
<td>Exception Class:</td>
<td><%= exception.getClass() %></td>
</tr>

<tr>
<td>Message:</td>
<td><%= exception.getMessage() %></td>
</tr>

</table>
</body>
</html>

decorators.xml:

<decorators defaultdir="/decorators">
    <decorator name="main" page="default.jsp">
        <pattern>/*</pattern>
    </decorator>
</decorators>

Result:
The start of default.jsp is shown, until the first <decorator:***/> tag is found (decorator:head in this case).
Then, it shows:
java.lang.NullPointerException
	at /decorators/default.jsp._jspService(/decorators/default.jsp.java:280) (JSP page line 1)
	at com.orionserver[Orion/2.0.4 (build 11197)].http.OrionHttpJspPage.service(.:62)
	at com.evermind[Orion/2.0.4 (build 11197)]._ay._rlb(.:5745)
	at com.evermind[Orion/2.0.4 (build 11197)].server.http.JSPServlet.service(.:31)
	at com.evermind[Orion/2.0.4 (build 11197)]._ha.doFilter(.:59)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:51)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb._prd(.:387)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb.include(.:90)
	at com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:171)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:71)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb._prd(.:387)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb._bpc(.:177)
	at com.evermind[Orion/2.0.4 (build 11197)]._ax._ltc(.:668)
	at com.evermind[Orion/2.0.4 (build 11197)]._ax._ubb(.:193)
	at com.evermind[Orion/2.0.4 (build 11197)]._bf.run(.:62)

If I only remove <%@ page errorPage="MyErrorPage.jsp" %> from TestErrorPage.jsp, I get the standard exception page:

500 Internal Server Error

java.lang.NullPointerException
	at /TestErrorPage.jsp._jspService(/TestErrorPage.jsp.java:32) (JSP page line 1)
	at com.orionserver[Orion/2.0.4 (build 11197)].http.OrionHttpJspPage.service(.:62)
	at com.evermind[Orion/2.0.4 (build 11197)]._ay._rlb(.:5745)
	at com.evermind[Orion/2.0.4 (build 11197)].server.http.JSPServlet.service(.:31)
	at com.evermind[Orion/2.0.4 (build 11197)]._ha.doFilter(.:59)
	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:130)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:64)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb._prd(.:387)
	at com.evermind[Orion/2.0.4 (build 11197)]._csb._bpc(.:177)
	at com.evermind[Orion/2.0.4 (build 11197)]._ax._ltc(.:668)
	at com.evermind[Orion/2.0.4 (build 11197)]._ax._ubb(.:193)
	at com.evermind[Orion/2.0.4 (build 11197)]._bf.run(.:62)

My problem is that I throw an exception in my controllers when I see that the session is expired, and the Error.jsp specified as the "page errorPage" in my *.jsp pages indicates that and allow the user to re-login. Since I started using sitemesh, all expired sessions shows the above exception instead of my Error.jsp

Any suggestion of what I could check to find the problem ?

Thank you,

- Guillaume Boudreau
TouchTunes

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=2267&messageID=6664#6664


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]