https://issues.apache.org/bugzilla/show_bug.cgi?id=48097

--- Comment #7 from Konstantin Kolinko <knst.koli...@gmail.com> 2009-11-01 
23:44:06 UTC ---
I debugged the case of the blank response.

The sequence of events is the following:

1) The index_jsp.class is successfully loaded, instantiated, and its _jspInit()
method was successfully called.
2) The error occurs in its _jspService(request, response) method.

The code there is the following:
    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
                  null, true, 8192, true);
      _jspx_page_context = pageContext;

(...)
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null)
_jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }

The exception occurs when calling response.setContentType(). The exception is:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission
accessClassInPackage.org.apache.catalina.connector)

Because it occurs earlier than the _jspx_page_context variable is initialized,
the _jspx_page_context.handlePageException(t); line is not called and empty
response is returned to the client.


The failure in setContentType() method occurs in
ResponseFacade#setContentType(). It is caused by the attempt to load the
following class: ResponseFacade$SetContentTypePrivilegedAction

That class is listed in
o.a.catalina.security.SecurityClassLoad#loadCoyotePackage() but, because I used
org.apache.catalina.startup.Catalina class to start Tomcat in the IDE, that
method was not called at all. It is called from Bootstrap#init() only.

Jasper's SecurityClassLoad on the contrary is called, because that occurs in
another place.

The blank page issue disappeared when I used o.a.c.startup.Bootstrap class
instead of Catalina.

I do not know, whether we should fix this bootstrap issue. (Is anyone
concerned?)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to