Bug 42071

Summary: If a JSP throws an UnavailableException twice, an IllegalStateException occurs.
Product: Tomcat 5 Reporter: kawasima <kawasima.kazuh>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.23   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: An IllegalStateException does not occurred with this patch.
reappearance jsp

Description kawasima 2007-04-08 17:49:37 UTC
If a JSP throws an UnavailableException twice, an IllegalStateException occurs.

first access:
JSP throws UnavailableException.

second access:
If the JSP throws an UnavailableException again then an IllegalStateException
occurs and Tomcat returns status code:500 to the client.

The problem is not that the IllegalStateException occurs.
The problem is that the JSP can be called even though it cannot be used.
Comment 1 kawasima 2007-04-08 18:01:24 UTC
Created attachment 19924 [details]
An IllegalStateException does not occurred with this patch.

An IllegalStateException does not occurred with this patch.
Comment 2 Mark Thomas 2007-04-14 17:45:07 UTC
I don't see an ISE with the latest source from svn.

If you still see the ISE with the latest svn source, please re-open this issue
and attach your JSP that shows the ISE.
Comment 3 kawasima 2007-04-17 00:40:41 UTC
Created attachment 19974 [details]
reappearance jsp

reappearance jsp
Comment 4 kawasima 2007-04-17 00:48:31 UTC
I see the ISE with the latest svn source.

It reappears in the following procedure.

first request:
/test.jsp?exp=true

second request:
/test.jsp?exp=true

[JSP]
<%@ page contentType="text/plain" %>
<%
    String exp = request.getParameter("exp");
    if("true".equalsIgnoreCase(exp)) {
        throw new UnavailableException("error!!!");
    }
    System.out.println("done!");
%>
done!
Comment 5 Mark Thomas 2007-04-18 19:29:09 UTC
This has been fixed in svn and will be included in 5.5.24 onwards and 6.0.12
onwards.

Thanks for the report and the test case.