tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45065] New: RequestDispatcher restricts access to ApplicationHttpRequest
Date Thu, 22 May 2008 22:26:51 GMT

           Summary: RequestDispatcher restricts access to
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina

This exception is generated when a servlet calls Method.invoke() on the
ServletRequest object when the servlet is run with RequestDispatcher.forward

java.lang.IllegalAccessException: Class
com.jotobjects.demo.formexample.FormExampleShowBean can not access a member of
class org.apache.catalina.core.ApplicationHttpRequest with modifiers "public"
        at sun.reflect.Reflection.ensureMemberAccess(
        at java.lang.reflect.Method.invoke(

When the servlet is run with normally with an HTTP request the Request class
is org.apache.catalina.connector.RequestFacade and the method can be invoked
with reflection.  But when the method is run with RequestDispatcher the
Request class is org.apache.catalina.core.ApplicationHttpRequest and
IllegalAccessException is raised.

Here is the code that causes the error -

java.lang.reflect.Method m =
Object value = m.invoke(getRequest(),null);

Have tried starting with a SecurityManager with AllPermissions
but this does not change the outcome.

Same problem in Tomcat 5 and Tomcat 4.

The same codes works in Tomcat 3 and with Jetty

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message