2 Replies Latest reply on Oct 6, 2015 5:20 PM by Shanmugam as

    EJB Remote Jndi lookup not bound in Jboss 5.2 EAP

    Shanmugam as Newbie

      I am trying to migrate Jboss 4.0.5 GA EAP to jboss 5.2 EAP. While doing this I am getting Remote EJB Jndi lookup not bound but same jar working in Jboss 4.0.5 EAP not working in Jboss 5.2 EAP.

       

      Code

      @Stateless

      @LocalBinding(jndiBinding = "com.x.y.z.CaseDaoBean/local")

      @RemoteBinding(jndiBinding = "com.x.y.z.CaseDaoBean/remote")

      public final class CaseDaoBean implements CaseDaoLocal, CaseDaoRemote {

       

       

      Jboss 5.2 EAP server log

      2015-10-05 17:58:11,252 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) installing bean: jboss.j2ee:jar=med-review-dao-5.1.3.jar,name=CaseDaoBean,service=EJB3

      2015-10-05 17:58:11,252 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   with dependencies:

      2015-10-05 17:58:11,252 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and demands:

      2015-10-05 17:58:11,253 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) jboss.ejb:service=EJBTimerService

      2015-10-05 17:58:11,253 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and supplies:

      2015-10-05 17:58:11,254 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) jndi:CaseDaoBean/local

      2015-10-05 17:58:11,254 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Class:com.x.y.z.CaseDaoLocal

      2015-10-05 17:58:11,254 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) jndi:CaseDaoBean/remote-com.x.y.z.CaseDaoRemote

      2015-10-05 17:58:11,255 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) jndi:CaseDaoBean/remote

      2015-10-05 17:58:11,255 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Class:com.x.y.z.CaseDaoRemote

      2015-10-05 17:58:11,255 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) jndi:CaseDaoBean/local-com.x.y.z.CaseDaoLocal

       

      Client code

      final JndiLookup<T> jndi = new JndiLookup<T>();

      CaseDaoRemote casedaoRemote=jndi.lookup("com.x.y.z.CaseDaoBean/remote");

       

      Exception

       

      18:14:36,382 | FATAL | pool-flow.seda.servicemix-cxf-se-thread-1 | reAllCasesServiceWrapper | .InquireAllCasesServiceWrapper   61 | Unrecoverable system exception occurred.

      com.x.y.z.exceptions.NoridianSystemException: com.x.y.z.CaseDaoBean not bound

       

       

      If I change Jndi binding/jndi name to "CaseDaoBean/remote" then its works fine.I have many ejbs are there so I want to see if any other solution to resolve and with minimal change.

       

      Working code.

       

      @Stateless

      public final class CaseDaoBean implements CaseDaoLocal, CaseDaoRemote {

       

      Client code

      final JndiLookup<T> jndi = new JndiLookup<T>();

      CaseDaoRemote casedaoRemote=jndi.lookup("CaseDaoBean/remote");

        • 1. Re: EJB Remote Jndi lookup not bound in Jboss 5.2 EAP
          Jay SenSharma Master

          Hello,

           

          The @LocalBinding and @RemoteBinding annotations are changed in EAP5  as following:

           

          import org.jboss.ejb3.annotation.LocalBinding;
          import org.jboss.ejb3.annotation.RemoteBinding;
          


          In JBoss 5 you can find the above classes as part of JAR:

          $JBOSS_HOME/client/jboss-ejb3-ext-api.jar

          $JBOSS_HOME/common/lib/jboss-ejb3-ext-api.jar



          However in JBoss 4 it was little different as following:

           

          import org.jboss.annotation.ejb.LocalBinding;
          import org.jboss.annotation.ejb.RemoteBinding;
          

           

          So can you please check if you are using the correct package names for defining your annotations?

           

          Also if you do not want to change the code then you can try playing with the "$YOUR_EJB_JAR.jar/META-INF/jboss.xml" file as following, to see if it works?

           

           

          <jboss>
             <enterprise-beans>
                <session>
                   <ejb-name>CaseDaoBean</ejb-name>
                   <jndi-name>com.x.y.z.CaseDaoBean/remote</jndi-name>
                   <local-jndi-name>com.x.y.z.CaseDaoBean/local</local-jndi-name>
                </session>
             </enterprise-beans>
          </jboss>
          
          • 2. Re: EJB Remote Jndi lookup not bound in Jboss 5.2 EAP
            Shanmugam as Newbie

            Its works in both ways.Thanks you for prompt answer.