Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1552

org.apache.openejb.core.interceptor.ReflectionInvocation can not access a timeout method with modifiers "private"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.7.0
    • None
    • ejb31
    • None

    Description

      This is a new regression I found in openejb trunk. A private method of EJB is defined in ejb-jar.xml as timeout method. It's legal from ejb 31 spec.18.2.5.3

      "A timeout callback method can have public, private, protected, or package level access. A timeout callback method must not be declared as final or static."

      In our code, we have logic to set the private method accessible.

      org.apache.openejb.assembler.classic.MethodScheduleBuilder.build(BeanContext, EnterpriseBeanInfo)

      { ...... //get the timeout method from the info in DD or annotation. timeoutMethodOfSchedule = MethodInfoUtil.toMethod(clazz, info.method); //set the method accessible so that we could call it even it's a private method. SetAccessible.on(timeoutMethodOfSchedule); ..... }

      It used to work well. And I can confirm these logic was executed when I debug into it. Can anyone shed some light on this ? At least, how could I tell if the private method was accessible after calling SetAccessible.on() to it ?

      Attachments

        1. 0004-OPENEJB-1552-org.apache.openejb.core.interceptor.Ref.patch
          2 kB
          Lin Quan Jiang
        2. timerEJB.jar
          2 kB
          Lin Quan Jiang

        Activity

          People

            genspring Lin Quan Jiang
            genspring Lin Quan Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: