How to specify a different jndi name than the default value for EJB in JBoss 4.2.2.GA?

By default, it seems that the name jndi bean is based on the ear in which it is contained. An EJB named MyBean my-app.ear will be named "my-app / MyBean / local".

How can I change this behavior declaratively? I want the jndi name to be "something-else / MyBean / local". It should be declarative rather than b / c annotation. I cannot change the source of MyBean.java; I only have a can that I pack in my ear for deployment.

+3
source share
2 answers

You can specify this in jboss.xml

http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_deployment_descriptor.html

jndi-name - , .

:

<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>
+3

EJB3 ( , ), EJB2 , jboss.xml, EJB JAR META-INF. , EJB.

EJB3 ( , EJB3 -lite), , , :)

0

Source: https://habr.com/ru/post/1710698/


All Articles