1 Reply Latest reply on Sep 28, 2012 6:41 AM by jaikiran

    Replacement for <jndi-name> of jboss.xml to allow versioned ear names?

    michael-s

      I am looking for a replacement for the <jndi-name> tag of jboss.xml. In the files (ejb-jar.xml and jboss-ejb3.xml) that are supposed to replace jboss.xml in JBoss 7 I could not find the tag any more. In JBoss 5.1 we used settings like this to add a custom jndi name for our beans because the default jndi name includes the ear name which inlcudes a version number in our case.

      <session>

           <ejb-name>MyBean</ejb-name>

           <jndi-name>myCustomName/MyBean/remote</jndi-name>

      </session>

      I know that a lookup name can be definded in the <bindings> section of the naming subsystem of JBoss7.1.1 but it has to be changed each time the version number changes:

        <lookup name="myCustomName/MyBean/remote" lookup="java:global/my-ear-name-1.2.3/my-ejb-jar-name/MyBean"/>

      We use versioned ear names because it makes integration testing of several components much easier.

      Is there any way to use versioned ear names in JBoss7 without changing jndi names all the time?

        • 1. Re: Replacement for <jndi-name> of jboss.xml to allow versioned ear names?
          jaikiran

          michael-s wrote:

           

          We use versioned ear names because it makes integration testing of several components much easier.

          Is there any way to use versioned ear names in JBoss7 without changing jndi names all the time?

          The EE spec allows you to specify a different application-name, module-name for those JNDI names via the deployment descriptors. By default the values for those are the same name as the file names. However, you can set them to a name of your choice. For the application-name, you can set it in the application.xml (see version 6 xsd). For module-name, depending on what module it is you can either set it in ejb-jar.xml (for EJB module) or web.xml (for web/war module). See their respective XSDs.