Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
8.0.0.Alpha3
-
None
Description
I have the following interfaces
public interface Bar { }
@Local public interface Foo { }
and a session bean
@Local(Bar.class) @Stateful public class SessionBean implements Foo { }
EJB 3.2 specification (4.9.7 Session Bean’s Business Interface) states:
"any interface of the bean class is explicitly designated as a business interface of the bean by either of the following means:
• using the Local or Remote annotation with a non-empty value on the bean class
• using the Local or Remote annotation on the interface
• in the deployment descriptor"
Therefore, I assume SessionBean should expose both Bar and Foo as local business interfaces. However, only Bar is exposed:
... INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named SessionBean in deployment unit deployment "pckg.war" are as follows: java:global/pckg/SessionBean!org.jboss. ... .Bar java:app/pckg/SessionBean!org.jboss. ... .Bar java:module/SessionBean!org.jboss. ... .Bar java:global/pckg/SessionBean java:app/pckg/SessionBean java:module/SessionBean
It seems that the @Local annotation on a session bean class "overrides" all information about @Local interfaces implemented using the keyword "implements". (It does not ignore @Remote interfaces implemented using the keyword "implements".)
The @Remote annotation on a session bean class works analogically - it causes @Remote interfaces implemented using the keyword "implements" not to be contained in the set of remote business interfaces.
I haven't tried yet what happens if I declare another interface(s) for certain session beans as local/remote in the deployment descriptor - whether those defined in the java classes become "overriden". But I'd like to know what SHOULD happen. If it is not clear from the EJB spec., the exact behaviour in such case should be stated specifically for Wildfly - I'd be grateful for any links to such information.