Velocity
  1. Velocity
  2. VELOCITY-579

Can not access a member of class X with modifiers "public" even if method is public

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      When upgrading from 1.4 to 1.5 none of my template is working anymore.

      For example :

      [javadoc] ERROR [console:logVelocityMessage] - ASTMethod.execute() : exception invoking method 'tags' in class com.sun.tools.javadoc.MethodDocImpl
      [javadoc] ERROR [console:logVelocityMessage] - java.lang.IllegalAccessException: Class org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl can not access a member of class com.sun.tools.javadoc.DocImpl with modifiers "public"

      The method 'tags()' is public in com.sun.javadoc.Doc, but the implementation is package protected. So the java.lang.reflect.Method object is well returned by the org.apache.velocity.util.introspection.Introspector but not accessible from templates.
      The same errors occured for example for javax.servlet.http.HttpSession Weblogic's implementation which is not public, but methods are !

      It's not possible to wrap all objects javax.servlet.http.HttpSession into public implementations ...

      The Introspector could call method.setAccessible(true) before returning Method object : if this method has been found, it is a public method !

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric Ballet Baz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development