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

           Summary: RequestDispatcher restricts access to
                    ApplicationHttpRequest
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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(Reflection.java:65)
        at java.lang.reflect.Method.invoke(Method.java:578)

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 =
      request.getClass().getDeclaredMethod("getPathInfo",null);
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: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to