By default it seems the jndi name of a bean is based on the ear in which it is contained. An EJB named MyBean my-app.ear will have the name "my-app/MyBean/local".
How can I change that behavior declaratively? I want the jndi name to be "something-else/MyBean/local". It has to be declarative rather than with an annotation b/c I can't modify the source of MyBean.java; I only have the jar, which I am packaging into an ear for deployment.
You can provide this in jboss.xml
jndi-name element is what you want.
Example:
<jboss>
<enterprise-beans>
<service>
<ejb-class>org.jboss.ejb3.test.service.ServiceSix</ejb-class>
<local>org.jboss.ejb3.test.service.ServiceSixLocal</local>
<remote>org.jboss.ejb3.test.service.ServiceSixRemote</remote>
<management>org.jboss.ejb3.test.service.ServiceSixManagement</management>
<jndi-name>serviceSix/remote</jndi-name>
<local-jndi-name>serviceSix/local</local-jndi-name>
</service>
</enterprise-beans>
</jboss>