Just ran into a new
behavior in the tomcat 5.5.16 regarding jsp errors that is pretty nice. Either a
compile or exception shows a line number delimited fragment of the jsp page that
caused the problem. For example:
org.apache.jasper.JasperException: Exception in JSP:
/jmx-test.jsp:31
28: String[] sig =
{"java.lang.String", "java.security.Principal",
"java.lang.Object"};
29: Set roles = (Set) conn.invoke(secMgr, "getUserRoles", params, sig);
30: if( roles == null || roles.size() == 0 )
31: throw new SecurityException("No roles found for jduke/theduke/jmx-console");
32: out.print("Roles: "+roles);
33: out.print('\n');
34: }
29: Set roles = (Set) conn.invoke(secMgr, "getUserRoles", params, sig);
30: if( roles == null || roles.size() == 0 )
31: throw new SecurityException("No roles found for jduke/theduke/jmx-console");
32: out.print("Roles: "+roles);
33: out.print('\n');
34: }
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
javax.servlet.ServletException: No roles found for
jduke/theduke/jmx-console
org.apache.jsp.jmx_002dtest_jsp._jspService(jmx_002dtest_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
org.apache.jsp.jmx_002dtest_jsp._jspService(jmx_002dtest_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
VP Architecture & Technology
Scott Stark
VP Architecture & Technology
JBoss Inc.
xxxxxxxxxxxxxxxxxxxxxxxxxxxx