3 Replies Latest reply on May 10, 2013 4:57 AM by Wolf-Dieter Fink

    where to configure JNDI in jboss AS 7.1.3 Final

    ANAND KUMAR GEORGE PREM KUMAR Newbie

      I understand that in jboss as 7.1.3 (EAP 6.0.1) , jboss.xml is no more supported.  Instead jboss-ejb3.xml is introduced and is used to override ejb-jar.xml or set the configurations specific to JBOSS AS7.

       

      Attached is my jboss.xml from jboss 4.3.0.GA, where the local and remote jndi names are set for the respsective ejbs. How can i set in the same way for jboss as 7.1.3. Any idea ?

        • 1. Re: where to configure JNDI in jboss AS 7.1.3 Final
          Wolf-Dieter Fink Master

          As the JNDI names are standartisized with EJB3.x spec there are some restrictions for the JNDI naming.

          For local names you can use the java:module/Myname for a lookup or map the names via the naming subsystem in the configuration to not change the code.

           

          The remote names are different and you cannot use mappedName to change.

          See the documentation for remote invocation

          1 of 1 people found this helpful
          • 2. Re: where to configure JNDI in jboss AS 7.1.3 Final
            ANAND KUMAR GEORGE PREM KUMAR Newbie

            Hello Wolf,

             

            Thanks for the reply.

             

            I tried mapping the names via the naming subsystem in the standalone-full.xml something this shown below, but it resulted in Name Not found exception only.

            For this Solution, i tried to lookup from the code using the jndi name as "com.cassis.cx.upgrade.VersionUpgraderLocal" (No Code Change, Existing implementation

             

            <subsystem xmlns="urn:jboss:domain:naming:1.2">

                        <<bindings>

                            <lookup name="com.cassis.cx.upgrade.VersionUpgraderLocal" lookup="java:module/com.cassis.cx.upgrade.VersionUpgrader!com.cassis.cx.upgrade.VersionUpgrader_LocalHome"/>

                        </bindings>

                       

                        <remote-naming/>

                    </subsystem>

             

             

            Since in my application (ear), the EJB module is lookedup by the WEB module via a Jar file residing in the ear/lib, i tried lookup using jndi in the below format and i succeeded . Now there is no problem with the jndi lookup.

             

            java:app/MobilematrixCX_ejb-1.0.0-SNAPSHOT/com.cassis.cx.upgrade.VersionUpgrader!com.cassis.cx.upgrade.VersionUpgrader_LocalHome

             

            Neverthless am still keen on the mapping approach in the standalone-full.xml , which does not require any code change.

            • 3. Re: where to configure JNDI in jboss AS 7.1.3 Final
              Wolf-Dieter Fink Master

              You might have a look to this quickstart. If you look to this class (line 100) there an alias is used. There is a indirection in ejb-jar.xml which use the standalone configured name (see install-domain.cli or follow the readme).