6 Replies Latest reply on Feb 9, 2013 3:10 PM by wdfink

    Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1

    shaikhdahood

      Hi Guys,

      I have an Enterprise application which is running fine on weblogic server, now I am trying to deploy the same app on Jboss server and I get the below error while JNDI look up,

       

      javax.ejb.EJBException: javax.naming.NameNotFoundException: GPUtilitySession#com.mycompany.ejb.GPUtilitySession -- service jboss.naming.context.java."GPUtilitySession#com.mycompany.ejb.GPUtilitySession"

       

      Are the JNDI look up server specific?

      If No, than how could i lookup something like MapedName#package.RemoteBeanName in my jboss server?

        • 1. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
          wdfink

          Yes, before EJB3.1 the naming of EJB's has no standard.

          Because of this standartisation of JNDI names in AS7 follow the EJB3.1 spec.

           

          You need to change the naming.

           

          If you have further questions you should state what kind of application you use and post the relevant part of sources.

           

          The documentation might help.

          • 2. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
            sfcoy

            Global JNDI names were not standardised until JEE6.

             

            Prior to that (if you wanted to write portable code) you were expected to map ENC names (ie java:env/ejb/BeanName) to a vendor specific global name in a vendor specific deployment descriptor.

             

            You would have given your EJBs their global names in a weblogic specific deployment descriptor, right?

             

            With JBoss AS 7.x, the JNDI names of each of your EJBs is listed in the server log:

             

            {code}

            [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named EchoBean in deployment unit subdeployment "ejb.jar" of deployment "ejb-remote-client-api-test.ear" are as follows:

             

                      java:global/ejb-remote-client-api-test/ejb/EchoBean!org.jboss.as.ejb.http.test.EchoRemote

                      java:app/ejb/EchoBean!org.jboss.as.ejb.http.test.EchoRemote

                      java:module/EchoBean!org.jboss.as.ejb.http.test.EchoRemote

                      java:jboss/exported/ejb-remote-client-api-test/ejb/EchoBean!org.jboss.as.ejb.http.test.EchoRemote

                      java:global/ejb-remote-client-api-test/ejb/EchoBean

                      java:app/ejb/EchoBean

                      java:module/EchoBean

            {code}

             

            If you must look EJBs up using JNDI, then you should select an appropriate name from the list as above.

             

            You will find more information in the AS71 Developer Guide.

            1 of 1 people found this helpful
            • 3. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
              shaikhdahood

              Thanks for the reply Stephen.

               

              But i am not using the weblogic deployment descriptor i.e weblogic-ejb-jar.xml , as I am using anootations.

               

              And i do get the JNDI binding for session bean in my server log for JBoss AS 7.1.

               

              As you see in the JNDI bindings we have ' ! '  should i replace my code(#) with ! to look up the JNDI ?

              below is how i look up in weblogic

               

                   InitialContext ic = new InitialContext();

                                      String lookupSession = GPUtilitySession#com.mycompany.ejb.GPUtilitySession;

                  session = (Object) ic.lookup(lookupSession);

              • 4. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
                sfcoy

                If you're using annotations why don't you just inject the reference and let the container worry about locating your EJBs?

                 

                BTW, I don't think AS7.x supports mappedName at the moment. It's certainly not required to do that.

                • 5. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
                  sfcoy

                  shaikh dahood wrote:

                   

                  And i do get the JNDI binding for session bean in my server log for JBoss AS 7.1.

                   

                  As you see in the JNDI bindings we have ' ! '  should i replace my code(#) with ! to look up the JNDI ?

                  below is how i look up in weblogic

                   

                       InitialContext ic = new InitialContext();

                                          String lookupSession = GPUtilitySession#com.mycompany.ejb.GPUtilitySession;

                      session = (Object) ic.lookup(lookupSession);

                   

                  You have to use one of the names listed in the server.log.

                  • 6. Re: Migration of EJBs from Weblogic 10.3 to Jboss AS 7.1
                    wdfink

                    You may havea look into the quickstarts. there are several examples. Inside a server youcan use the multi-server QS, there are different aproaches how to use EJB invocation.