javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

Certain illegal invocations of methods on a bean class local view cannot be detected. #104

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

Section 3.4.4 says:

Only public methods of the bean class and of any superclasses except the java.lang.Object, may be invoked through the no-interface view. Attempted invocations of methods with any other access modifiers via the no-interface view reference must result in the javax.ejb.EJBException.

Since a method with another access modifier (let's say a protected method) may be declared final I cannot see a way the container could reliably use a proxy to wrap the method invocation. Since the container cannot wrap the invocation, there is not way for container to detect the attempted invocation and throw javax.ejb.EJBException - which the spec requires.

Affected Versions

[3.2]

glassfishrobot commented 11 years ago

Reported by jharting

glassfishrobot commented 11 years ago

mvatkina said: EJB 3.1 said "All methods of the bean class and any superclasses must not be declared final". We tried to relax this restriction, and it is definitely too harsh for private methods - you can't access them through proxy anyway. We can relax less

glassfishrobot commented 11 years ago

mvatkina said: Will change the "non-final" rule to: "Only private methods of the bean class and any superclasses may be declared final."

Will also add both restrictions to the message listener methods with a no-methods interface.

glassfishrobot commented 11 years ago

mvatkina said: The final rule is: "Only private methods of the bean class and any superclasses except java.lang.Object may be declared final."

The existing rule requires the EJB Container to prevent access of protected and package private methods.

glassfishrobot commented 11 years ago

Was assigned to mvatkina

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA EJB_SPEC-104

glassfishrobot commented 11 years ago

Marked as fixed on Monday, April 8th 2013, 1:16:34 pm