6 Replies Latest reply on Mar 27, 2012 9:16 AM by halliballi

    Jboss 7.1 EJB 2.1 Remote JNDI

    halliballi

      Hallo everybody,

       

      I have a project that is currently running on JBoss 4 and I have to migrate to JBoss 7

       

      I downloaded the current Version (JBoss 7.1.1), configured standalone.xml to use my database.

      The deployment seems to work.

       

      Than I found out, that remote jndi using port 1099 is not longer supported so I tried using remoting for JNDI

       

      But now I have the problem that I don't know how to get my Beans remotely. The naming has changed. My Beans all have names like java:global or java:app

       

      I read that I have to use ejb: to remotely use my Beans. Does this mean that I have to change the naming in my XML of the Beans or do I have to switch to EJB 3 specs?

      Or is there a way to map the names from java:something too ejb:something?

       

      Regards

        • 1. Re: Jboss 7.1 EJB 2.1 Remote JNDI
          thinksteep

          Hi,

           

          Try to follow the steps specified in below link. It should work.

          https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

          • 2. Re: Jboss 7.1 EJB 2.1 Remote JNDI
            ayagmur

            you may use these namings :

             

            XXXRemote remote=(XXXRemote)context.lookup("xxx-ear/xxx-EJB//XXXBean!xxx.XXXRemote");


            • 3. Re: Jboss 7.1 EJB 2.1 Remote JNDI
              prasad.deshpande

              I read that I have to use ejb: to remotely use my Beans. Does this mean that I have to change the naming in my XML of the Beans or do I have to switch to EJB 3 specs?

              Or is there a way to map the names from java:something too ejb:something?

              You don't necessarily have to use "ejb:" namespace. You can use combination of <appName>/<moduleName>/<beanName>!<fqn of interface> to get the remote remote interface implementation. You'll need to pass set of properties to InitialContext before that.

              • 4. Re: Jboss 7.1 EJB 2.1 Remote JNDI
                halliballi

                I knew the example as described here

                 

                Try to follow the steps specified in below link. It should work.

                https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

                 

                and it is working for me. I can remotely lookup the Calculater and use it.

                 

                But when I deploy my 2.1 Beans I can not remotly get them.

                I can skip the "ejb:"? is this true?

                 

                Can anyone tell me how I can get the correct name for my remote JNDI lookup for a Bean that is deployed like this?

                Do I need "?stateful" or "?stateless" or can I skip the parameter too?

                 

                {code}

                java:global/deminag/deminag_zdb-server/PartyFacadeEJB!com.bvg.mod.zdb.comps.party.common.PartyFacadeHome

                java:app/deminag_zdb-server/PartyFacadeEJB!com.bvg.mod.zdb.comps.party.common.PartyFacadeHome

                java:jboss/exported/deminag/deminag_zdb-server/PartyFacadeEJB!com.bvg.mod.zdb.comps.party.common.PartyFacadeHome

                {code}

                 

                regards

                • 5. Re: Jboss 7.1 EJB 2.1 Remote JNDI
                  jaikiran

                  What exact errors do you see and what does your client code and configuration look like?

                  • 6. Re: Jboss 7.1 EJB 2.1 Remote JNDI
                    halliballi

                    I solved the problem. It was not an naming issue.

                    The problem was caused by my project configuration in NetBeans. The properties file was not read for my EJB 2.1 Beans but for the EJB 3 example.

                    I am very sorry. Thank you very much.

                     

                    And for people who are interested, the name for remote JNDI that I use for my EJB 2.1 Beans is:

                     

                    {code}

                    ejb:deminag/deminag_zdb-server//PartyFacadeEJB!com.bvg.mod.zdb.comps.party.common.PartyFacadeHome?stateless

                    {code}

                     

                    Regards