3 Replies Latest reply on Jul 6, 2011 8:01 AM by oourfali

    EJB not loaded

    oourfali

      I have an ear with an ejb jar (and some other jars+wars).

       

      The EJB is:

       

      @Local(BackendInternal.class)

      @Service

      public class Backend implements BackendInternal, BackendRemote {

      ...

      ...

      }

       

      I have another jar that depends on it.

       

      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)

      @BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)

      @Addressing(enabled = true, required = true)

      @WebService(name = "IBackendCxf", serviceName = "IBackend", targetNamespace = "http://service.org.nogah")

      @Stateless

      @Interceptors({ CXFContextInterceptor.class })

      @Depends("jboss.j2ee:ear=rhevm.ear,jar=rhevm-bll.jar,name=Backend,service=EJB3")

      public class GenericApiService {

       

          @EJB(name="Backend")

          private static BackendInternal backend;

       

      When I try to deploy the ear, I get:

       

      11:04:30,307 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."rhevm.ear"."rhevm-genericapi.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."rhevm.ear"."rhevm-genericapi.jar".INSTALL: Failed to process phase INSTALL of subdeployment "rhevm-genericapi.jar" of deployment "rhevm.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No component found for type 'org.nogah.bll.interfaces.BackendInternal' with name null

              at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:68)

              at org.jboss.as.ee.component.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:210)

              at org.jboss.as.ee.component.ComponentInstallProcessor.access$200(ComponentInstallProcessor.java:49)

              at org.jboss.as.ee.component.ComponentInstallProcessor$1.handle(ComponentInstallProcessor.java:175)

              at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)

              at org.jboss.as.ee.component.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:172)

              at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:75)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

       

      What am I doing wrong?

      I tried to put the name "java:global/rhevm/rhevm-bll/Backend as well, but it didn't work as well.

       

      I have other ejbs that succeed to load, but not this one.

       

      It works well on jboss 5.1.

       

      Thank you,

      Oved

        • 1. Re: EJB not loaded
          swd847

          Try

           

          @EJB(beanName="Backend")

           

          or

           

          @EJB(lookup="java:global/rhevm/rhevm-bll/Backend")

          • 2. Re: EJB not loaded
            jaikiran
            @Service
            public class Backend implements BackendInternal, BackendRemote {
            

             

            We actually don't support JBoss specific @Service in AS7. Try @javax.ejb.Singleton, instead. Although it's not the same, it does provide some similar functionalities when used with @Startup annotation. It however doesn't register a MBean like the @Service used to do.

            • 3. Re: EJB not loaded
              oourfali

              My problem was that I user services, which is not supported in AS7.

              Have to use @Singleton instread.

               

              Thank you,

              Oved