org.apache.openejb.core.interceptor.ReflectionInvocation can not access a
timeout method with modifiers "private"
-----------------------------------------------------------------------------------------------------------------
Key: OPENEJB-1552
URL: https://issues.apache.org/jira/browse/OPENEJB-1552
Project: OpenEJB
Issue Type: Bug
Components: ejb31
Affects Versions: (trunk/openejb3)
Reporter: Shawn Jiang
Attachments: timerEJB.jar
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 ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira