I have a stateless remote session bean with a @RemoteBinding(jndiBinding="jndiToBeOverridden") annotation.
In its ejb-jar.xml I have the following:
<ejb-jar>
<enterprise-beans>
<ejb-name>AnyRandomName</ejb-name>
my.Remote
<ejb-class>my.Bean</ejb-class>
</enterprise-beans>
</ejb-jar>
In its jboss.xml I have the following:
<enterprise-beans>
<ejb-name>AnyRandomName</ejb-name>
<jndi-name>overridingJNDIName</jndi-name>
</enterprise-beans>
When viewing the JNDI tree for my deployment, I see TWO jndi names when I would expect to see one:
overridingJNDIName and jndiToBeOverridden, when I expect to see only the former
Why is this happening this way? What am I doing wrong?
As per the documentation, the jndi name mentioned in the jboss.xml will override the one mentioned using annotation. Are you able to lookup the bean using both of these jndi names?