3 Replies Latest reply on Dec 9, 2014 8:16 AM by jaysensharma

    ejb not exported, missing dependency

    settholo

      Hello,

           I'm deploying an ejb in jboss eap 6.3 packaged as a jar.

       

      11:23:35,614 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named SynchronizationEJBImpl in deployment unit deployment "clustertest-ejb-1.0.0-SNAPSHOT.jar" are as follows:

       

       

        java:global/clustertest-ejb-1.0.0-SNAPSHOT/SynchronizationEJBImpl!com.xxx.clustertest.ejb.ClusterTestSynchronizationEJB

        java:app/clustertest-ejb-1.0.0-SNAPSHOT/SynchronizationEJBImpl!com.xxx.clustertest.ejb.ClusterTestSynchronizationEJB

        java:module/SynchronizationEJBImpl!com.xxx.clustertest.ejb.ClusterTestSynchronizationEJB

        java:global/clustertest-ejb-1.0.0-SNAPSHOT/SynchronizationEJBImpl

        java:app/clustertest-ejb-1.0.0-SNAPSHOT/SynchronizationEJBImpl

        java:module/SynchronizationEJBImpl

       

      My problem is that the ejb is not exported, thus not accessible remotely. At the end of the log I see this error message, I cannot figure out what does it means:

       

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.naming.context.java.jboss.exported.app.clustertestb."SynchronizationEJBImpl!com.domosafety.clustertest.ejb.ClusterTestSynchronizationEJB" (missing) dependents: [service jboss.naming.context.java.comp."clustertest-ejb-1.0.0-SNAPSHOT"."clustertest-ejb-1.0.0-SNAPSHOT".SynchronizationEJBImpl.env.clusterTestSynchronizationEJB]

       

      Any help?

      Thank you very much

        • 1. Re: ejb not exported, missing dependency
          jaysensharma

          As you mentioned:

          My problem is that the ejb is not exported, thus not accessible remotely.

           

             This usually happens when you do not use @javax.ejb.Remote annotation on your bean interface. Looks like you might have used  @javax.ejb.Local annotation for your  interface:  "com.xxx.clustertest.ejb.ClusterTestSynchronizationEJB",   If yes, then change it to @Remote  sothat it's JNDI name will have "exported"

           

           

             Regarding your [JBAS014775:  New missing/unsatisfied dependencies] can you attach your complete log.  Is there any code which is trying to lookup this EJB using  "exported" JNDI name?   

             Local JNDI lookup can be simply achieved using the JNDI names which are listed in the output above.    

          1 of 1 people found this helpful
          • 2. Re: ejb not exported, missing dependency
            settholo

            The interface was annotated with @Local indeed, but I got into a weird situation.

            Changing the dependency to:

                    

            <!-- Import the Common Annotations API (JSR-250), we use provided scope

                        as the API is included in JBoss EAP 6 -->

                    <dependency>

                        <groupId>org.jboss.spec.javax.annotation</groupId>

                        <artifactId>jboss-annotations-api_1.1_spec</artifactId>

                        <scope>provided</scope>

                    </dependency>

             

             

                    <!-- Import the EJB 3.1 API, we use provided scope as the API is included in JBoss EAP 6 -->

                    <dependency>

                        <groupId>org.jboss.spec.javax.ejb</groupId>

                        <artifactId>jboss-ejb-api_3.1_spec</artifactId>

                        <scope>provided</scope>

                    </dependency>

             

            as found in an example instead of using the last versions present in maven repositories caused the ejb packaged in jar to be exported and the jboss dependency issue to be solved.

            If I package the ejb in a war, with the same dependencies, it's not exported.

            Also after changing the annotation to @Remote as you mentioned the same behavior happens.

            What should I do to package the ejb into the war archive and still have it exported?

            Thank you very much for your help

            • 3. Re: Re: ejb not exported, missing dependency
              jaysensharma

              Can you try comparing  my demo WebApp with Yours?

               

              I tried the following kind of SLSB using @Remote interface

               

              package ejbs;
              import javax.ejb.*;
              @Remote
              public interface TestEJBIntf  {
                  public String sayHello(String name);
                }
              

               

              After deploying i see the JNDI names as following  (I see exported there):

               

              18:41:15,453 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-8) JNDI bindings for session bean named TestEJB in deployment unit deployment "WebBasedEJBDemo.war" are as follows:
              
                  java:global/WebBasedEJBDemo/TestEJB!ejbs.TestEJBIntf
                  java:app/WebBasedEJBDemo/TestEJB!ejbs.TestEJBIntf
                  java:module/TestEJB!ejbs.TestEJBIntf
                  java:jboss/exported/WebBasedEJBDemo/TestEJB!ejbs.TestEJBIntf
                  java:global/WebBasedEJBDemo/TestEJB
                  java:app/WebBasedEJBDemo/TestEJB
                  java:module/TestEJB
              

               

               

              I can see the Servlet which is able to look it up with all the possible JNDI names:

               

              18:41:15,469 INFO  [org.jboss.web] (ServerService Thread Pool -- 129) JBAS018210: Register web context: /WebBasedEJBDemo
              18:41:15,505 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018565: Replaced deployment "WebBasedEJBDemo.war" with deployment "WebBasedEJBDemo.war"
              18:41:19,265 INFO  [stdout] (http-/127.0.0.1:8080-1) TestServlet Initialized & Instantiated.
              18:41:19,267 INFO  [stdout] (http-/127.0.0.1:8080-1) [TestEJB] sayHelo(EE6) invoked.
              18:41:19,268 INFO  [stdout] (http-/127.0.0.1:8080-1) [TestServlet] result  = Hello Mr. EE6
              

               

               

              After deploying the WAR on EAP 6.3 try hitting URL:     http://localhost:8080/WebBasedEJBDemo/TestServlet