7 Replies Latest reply on Nov 5, 2009 9:58 PM by steeven steeven

    NotBoundException when @Service POJO invoke EJB

    steeven steeven Newbie

      AS5.1.0, NO EJB3 Plugin installed.

      I packed service POJO and EJB3 SLSB together and the EJB injected to service bean doesn't worked steady. Sometimes the following exception raised when server start up and deploy.

      Is it a reason that EJB3 and Service POJO deployed in same time?
      The start() method invoked without related EJB/service ready?
      Is it possible to make this service POJO depend on EJB?

      I want to use Service POJO to do some initialization works when application server start up, am I lost in wrong direction?

      @Service(name = CmModule.SERVICE_NAME)
      public class CmModule implements ICmModule {
       public final static String SERVICE_NAME = "CmModule";
      
       Logger log = LoggerFactory.getLogger(CmModule.class);
      
       @EJB
       private IMoService moService;
      
       @TransactionAttribute(TransactionAttributeType.REQUIRED)
       public void start(){
       log.info("Cm Module started");
       moService.hello();
       log.info("Default Domain has been added.");
       }
      }



      5:51:23,084 INFO [CmModule] Cm Module started
      15:51:23,084 ERROR [STDERR] org.jboss.ejb3.common.registrar.spi.NotBoundException: Object is bound at key jboss.j2ee:ear=ems.ear,jar=ems-server.jar,name=MoService,service=EJB3, but is not fully installed, instead of state: ControllerState@18dbaa6{Start}
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.lookup(Ejb3McRegistrar.java:170)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.lookup(Ejb3McRegistrar.java:134)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.getContainerLocally(SessionProxyInvocationHandlerBase.java:410)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler.getContainer(SessionLocalProxyInvocationHandler.java:87)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:193)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
      15:51:23,084 ERROR [STDERR] at $Proxy411.get(Unknown Source)
      15:51:23,084 ERROR [STDERR] at org.steeven.cm.CmModule.checkDefaultDomain(CmModule.java:51)
      15:51:23,084 ERROR [STDERR] at org.steeven.cm.CmModule.start(CmModule.java:43)
      15:51:23,084 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      15:51:23,084 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      15:51:23,084 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      15:51:23,084 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.service.ServiceContainer.invokeOptionalMethod(ServiceContainer.java:369)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.java:264)
      15:51:23,084 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
      15:51:23,084 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      15:51:23,084 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      15:51:23,084 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      15:51:23,084 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      15:51:23,084 ERROR [STDERR] at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
      15:51:23,084 ERROR [STDERR] at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
      15:51:23,084 ERROR [STDERR] at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
      15:51:23,084 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
      15:51:23,084 ERROR [STDERR] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
      15:51:23,084 ERROR [STDERR] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
      15:51:23,084 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      15:51:23,084 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      15:51:23,084 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      15:51:23,100 ERROR [STDERR] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      15:51:23,100 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
      15:51:23,100 ERROR [STDERR] at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
      15:51:23,100 ERROR [STDERR] at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
      15:51:23,100 ERROR [STDERR] at org.jboss.Main.boot(Main.java:221)
      15:51:23,100 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:556)
      15:51:23,100 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
      15:51:23,100 INFO [CmModule] Default Domain has been added.