1 Reply Latest reply on Dec 17, 2013 9:50 AM by wdfink

    JNDI Name issue in migration of weblogic project to JBOSS7.1 Project

    sanjmand

      Hi.

       

      I'm working on migration project ,where we are migrating the application from Weblogic 9.0 to JBoss AS 7.1.1. In this project we have around  8 Ear files and 6 War files. All the ear files have  EJB classes but some of the classes are common in  different Ear files. since the code is already supporting weblogic ,so the jndi name used here is like "com/jsebfranck/jboss/ejb2/session/HelloWorldEJB".

       

      when i deployed a sample application containing HelloWorldEJB , i got the following message in the jboss console:

       

      ########################

      2:42:16,519 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-5) JNDI bindings for session bean named HelloWorldEJB in deployment unit deployment "myapps.war" are as follows:

       

             java:global/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJBHome

             java:app/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJBHome

             java:module/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJBHome

             java:jboss/exported/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJBHome

             java:global/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJB

             java:app/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJB

             java:module/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJB

             java:jboss/exported/myapps/HelloWorldEJB!com.jsebfranck.jboss.ejb2.session.HelloWorldEJB

       

      #####################

       

      The above message is saying that HelloWorldEJB is bounded with name having prefix "java:global/myapps" , "java:app/myapps" and "java:module"  where myapps is root context , but i need to use name "com/jsebfranck/jboss/ejb2/session/HelloWorldEJB" without any prefix containing context root (myapps for above case).

       

      Is there any way to use the same JNDI name like "com/jsebfranck/jboss/ejb2/session/HelloWorldEJB" for JBoss7.1.

       

      Regards

      Sanjeev Kumar

        • 1. Re: JNDI Name issue in migration of weblogic project to JBOSS7.1 Project
          wdfink

          With JavaEE6 the JNDI names are standardized, therefore you can use earname/jarname/.... but there is no way to customize the name like you want.

          A solution, according to the ejb specification, is to use a local name inside the bean and use the ejb-jar DD with the ejb-ref element to address the foreign bean.

          In that case you are able to use the naming subsystem in the configuration to map the names.