3 Replies Latest reply on Nov 14, 2011 5:50 PM by swd847

    EJB Local reference

    spandit2

      Folks ,

       

      I am trying to deploy an ear containing two ejb's . Both the ejb's are stateless session .  Both the ejb's are in the same Jar file .

       

      Definition of First EJB is like this

       

      <ejb-name>SystemAccess</ejb-name>

       

               <local-home>com.csc.fs.sa.ejb.SystemAccessLocalHome</local-home>

               <local>com.csc.fs.sa.ejb.SystemAccessLocal</local>

               <ejb-class>com.csc.fs.sa.ejb.SystemAccessSession</ejb-class>

               <session-type>Stateless</session-type>

               <transaction-type>Bean</transaction-type>

       

      When I start the server , the log message indicates that the JNDI binding is done .

       

      16:08:35,001 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named SystemAccess in deployment unit subdeployment "accelEJB.jar" of deployment "formsMgmtAdminJB7EARa.ear" are as follows:

       

          java:global/formsMgmtAdminJB7EARa/accelEJB/SystemAccess!com.csc.fs.SystemAccess

          java:app/accelEJB/SystemAccess!com.csc.fs.SystemAccess

          java:module/SystemAccess!com.csc.fs.SystemAccess

          java:global/formsMgmtAdminJB7EARa/accelEJB/SystemAccess

          java:app/accelEJB/SystemAccess

          java:module/SystemAccess

       

      16:08:35,001 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named ServiceController in deployment unit subdeployment "accelEJB.jar" of deployment "formsMgmtAdminJB7EARa.ear" are as follows:

       

          java:global/formsMgmtAdminJB7EARa/accelEJB/ServiceController!com.csc.fs.ejb.ServiceControllerSession

          java:app/accelEJB/ServiceController!com.csc.fs.ejb.ServiceControllerSession

          java:module/ServiceController!com.csc.fs.ejb.ServiceControllerSession

          java:global/formsMgmtAdminJB7EARa/accelEJB/ServiceController

          java:app/accelEJB/ServiceController

          java:module/ServiceController

       

      However  the second EJB has ejb-local-ref to first ejb

       

      <ejb-local-ref id="EJBLocalRef_1">

                  <ejb-ref-name>ejb/accelerator/comp/SystemAccess</ejb-ref-name>

                  <ejb-ref-type>Session</ejb-ref-type>

                  <local-home>com.csc.fs.sa.ejb.SystemAccessLocalHome</local-home>

                  <local>com.csc.fs.sa.ejb.SystemAccessLocal</local>

                  <ejb-link>java:module/SystemAccess</ejb-link>

               </ejb-local-ref>

       

      Jboss throws an error saying

       

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No component found for type 'com.csc.fs.sa.ejb.SystemAccessLocal' with name java:module/SystemAccess

       

      What am I missing here . Is the local reference not supported ?

       

      Can some one shed some light please ? Is there any sample out there ?

       

      Thanks

      Sunil

        • 1. Re: EJB Local reference
          swd847

          You should use either:

           

           

          <ejb-link>SystemAccess</ejb-link>

           

          Or

           

          <lookup-name  >java:module/SystemAccess</lookup-name>


          ejb-link does not specify a JNDI name.

          • 2. Re: EJB Local reference
            spandit2

            Thanks Stuartfor quick response .

             

            I tried using <ejb-link>SystemAccess</ejb-link>

             

            But I still get same error .

             

            Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No component found for type 'com.csc.fs.sa.ejb.SystemAccessLocal' with name SystemAccess

             

            How do I use ejb-link ? does ejb-local-ref supports that ?

             

            I must mention that this is EJB 2.0 and not 3.0

             

            Thanks again

            Sunil

            • 3. Re: EJB Local reference
              swd847

              What version of AS7 are you using? EJB 2.x is not fully implemented in 7.0.2. You will probably have better luck if you build from upstream.