7 Replies Latest reply on Jan 15, 2009 5:34 AM by jaikiran

    EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA

    jaikiran

      The "service" tutorial fails against the JBossAS-5.0 GA server.

      The @Service is almost on the lines of what we have in our testsuite, except for one difference. The one in the tutorial uses @Depends on a field/method to inject a application specific type object:

      @Service(objectName = ServiceThree.OBJECT_NAME)
      @Management(ServiceThreeManagement.class)
      @Depends(
      {ServiceTwo.OBJECT_NAME, ServiceOne.OBJECT_NAME})
      public class ServiceThree implements ServiceThreeManagement
      {
       /**
       * The ObjectName for {@link ServiceThree}
       */
       public static final String OBJECT_NAME = "tutorial:service=ServiceThree";
      
       // This one works - see the way this is handled in the Dependency*Injector
       @Depends(ServiceOne.OBJECT_NAME)
       public ObjectName serviceOneName;
      
      
       private ServiceTwoManagement service2;
      
       // Its this injection which causes problem
       @Depends(ServiceTwo.OBJECT_NAME)
       public void setServiceTwo(ServiceTwoManagement service2)
       {
       this.service2 = service2;
       }
      
       public String serviceOneHello() throws Exception
       {
       Object[] args = new Object[0];
       String[] signature = new String[0];
       System.out.println("ServiceThree - Calling ServiceOne.sayHello() via JMX server");
       MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
       return (String) server.invoke(serviceOneName, "sayHello", args, signature);
       }
      
       public String serviceTwoHello()
       {
       System.out.println("ServiceThree - Calling ServiceTwo.sayHello() via MBean proxy");
       return service2.sayHello();
       }
      

      And this is the logs that i see on the console:

      14:31:39,435 INFO [JBossASKernel] Created KernelDeployment for: jboss-ejb3-tutorial-service.jar
      14:31:39,435 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceOne,service=EJB3
      14:31:39,435 INFO [JBossASKernel] with dependencies:
      14:31:39,435 INFO [JBossASKernel] and demands:
      14:31:39,435 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      14:31:39,435 INFO [JBossASKernel] and supplies:
      14:31:39,435 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneManagement
      14:31:39,435 INFO [JBossASKernel] jndi:ServiceOne/remote
      14:31:39,435 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneLocal
      14:31:39,435 INFO [JBossASKernel] jndi:ServiceOne/local-org.jboss.tutorial.service.bean.ServiceOneLocal
      14:31:39,435 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneRemote
      14:31:39,435 INFO [JBossASKernel] jndi:ServiceOne/remote-org.jboss.tutorial.service.bean.ServiceOneRemote
      14:31:39,435 INFO [JBossASKernel] jndi:ServiceOne/local
      14:31:39,435 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceOne,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-service.jar
      14:31:39,436 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceThree,service=EJB3
      14:31:39,436 INFO [JBossASKernel] with dependencies:
      14:31:39,436 INFO [JBossASKernel] and demands:
      14:31:39,436 INFO [JBossASKernel] tutorial:service=ServiceTwo
      14:31:39,436 INFO [JBossASKernel] tutorial:service=ServiceOne
      14:31:39,436 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      14:31:39,436 INFO [JBossASKernel] and supplies:
      14:31:39,436 INFO [JBossASKernel] jndi:ServiceThree/remote
      14:31:39,436 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceThreeManagement
      14:31:39,436 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceThree,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-service.jar
      14:31:39,437 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceTwo,service=EJB3
      14:31:39,437 INFO [JBossASKernel] with dependencies:
      14:31:39,437 INFO [JBossASKernel] and demands:
      14:31:39,437 INFO [JBossASKernel] tutorial:service=ServiceOne
      14:31:39,437 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      14:31:39,437 INFO [JBossASKernel] and supplies:
      14:31:39,437 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceTwoManagement
      14:31:39,437 INFO [JBossASKernel] jndi:ServiceTwo/remote
      14:31:39,437 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceTwo,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-service.jar
      14:31:39,486 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.service.bean.ServiceOne ejbName: ServiceOne
      14:31:39,504 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
       ServiceOne/remote - EJB3.x Default Remote Business Interface
       ServiceOne/remote-org.jboss.tutorial.service.bean.ServiceOneRemote - EJB3.x Remote Business Interface
       ServiceOne/local - EJB3.x Default Local Business Interface
       ServiceOne/local-org.jboss.tutorial.service.bean.ServiceOneLocal - EJB3.x Local Business Interface
      
      14:31:39,526 INFO [JBossASKernel] installing bean: tutorial:service=ServiceOne
      14:31:39,526 INFO [JBossASKernel] with dependencies:
      14:31:39,527 INFO [JBossASKernel] and demands:
      14:31:39,527 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      14:31:39,527 INFO [JBossASKernel] and supplies:
      14:31:39,527 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneManagement
      14:31:39,527 INFO [JBossASKernel] jndi:ServiceOne/remote
      14:31:39,527 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneLocal
      14:31:39,527 INFO [JBossASKernel] jndi:ServiceOne/local-org.jboss.tutorial.service.bean.ServiceOneLocal
      14:31:39,527 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneRemote
      14:31:39,527 INFO [JBossASKernel] jndi:ServiceOne/remote-org.jboss.tutorial.service.bean.ServiceOneRemote
      14:31:39,527 INFO [JBossASKernel] jndi:ServiceOne/local
      14:31:39,549 INFO [JBossASKernel] Installing bean(tutorial:service=ServiceOne) into kernel
      14:31:39,578 INFO [STDOUT] ServiceOne - Creating
      14:31:39,595 INFO [STDOUT] ServiceOne - Starting
      14:31:39,667 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.service.bean.ServiceThree ejbName: ServiceThree
      14:31:39,667 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
      
      14:31:39,702 ERROR [ServiceContainer] Encountered an error in start of ServiceThree
      java.lang.RuntimeException: Error creating MBeanProxy: tutorial:service=ServiceTwo
       at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:415)
       at org.jboss.mx.util.MBeanProxyExt.<init>(MBeanProxyExt.java:99)
       at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:394)
       at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:349)
       at org.jboss.injection.DependsMethodInjector.inject(DependsMethodInjector.java:67)
       at org.jboss.injection.DependsMethodInjector.inject(DependsMethodInjector.java:52)
       at org.jboss.ejb3.service.ServiceContainer.injectDependencies(ServiceContainer.java:594)
       at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.java:296)
       at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:879)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
      .....
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.management.InstanceNotFoundException: tutorial:service=ServiceTwo is not registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
       at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:675)
       at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:407)
       ... 61 more
      ....
      14:31:39,797 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.service.bean.ServiceTwo ejbName: ServiceTwo
      14:31:39,800 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
      
      14:31:39,835 INFO [JBossASKernel] installing bean: tutorial:service=ServiceTwo
      14:31:39,835 INFO [JBossASKernel] with dependencies:
      14:31:39,835 INFO [JBossASKernel] and demands:
      14:31:39,835 INFO [JBossASKernel] tutorial:service=ServiceOne
      14:31:39,835 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      14:31:39,835 INFO [JBossASKernel] and supplies:
      14:31:39,835 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceTwoManagement
      14:31:39,835 INFO [JBossASKernel] jndi:ServiceTwo/remote
      14:31:39,840 INFO [JBossASKernel] Installing bean(tutorial:service=ServiceTwo) into kernel
      14:31:39,847 INFO [STDOUT] ServiceTwo - Starting
      14:31:39,875 WARN [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      

      It's the DependsMethodInjector (and also the DependsFieldInjector) which has this code:

      public void inject(Object instance)
       {
       Class clazz = method.getParameterTypes()[0];
       Object value = null;
      
       if (clazz == ObjectName.class)
       {
       value = on;
       }
       else
       {
       // Fails here since the service with the specified ObjectName has not yet started
       MBeanServer server = MBeanServerLocator.locateJBoss();
       value = MBeanProxyExt.create(clazz, on, server);
       }
      
       try
       {
       method.invoke(instance, value);
       }
      
      
      


      As can be seen in the code, the inject method isn't aware that the service isn't yet registered.

      Questions:

      1) What does @Depends signify at a field/method level? I thought @Depends was more for specifying a dependency. But going by the code in the DependsMethodInjector/DependsFieldInjector, it seems to be doing injection.

      2) Is this a valid use of @Depends? If yes, is there a way to make the injector(s) aware of the current state of the MBean, its trying to inject?

      P.S: This tutorial is in a compiling state and i can commit it to our trunk (leaving it out from the parent pom to avoid my Hudson runs breaking), if you want to have a look at the complete example.



        • 1. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
          jaikiran

           

          "jaikiran" wrote:


          1) What does @Depends signify at a field/method level? I thought @Depends was more for specifying a dependency. But going by the code in the DependsMethodInjector/DependsFieldInjector, it seems to be doing injection.


          Just read the javadoc of org.jboss.ejb3.annotation.Depends:

          Annotation for specifying a deployment dependency for a bean. If placed on a setter method or field an MBean proxy will be injected as well.

          So injection is intentional.

          "jaikiran" wrote:

          2) Is this a valid use of @Depends?


          Based on the above javadoc statement, looks like a valid usecase.



          • 2. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
            alrubinger

            May not work against GA, but does it work against current Plugin?

            This past week I'd added some more required MC "depends" during ServiceContainer start.

            S,
            ALR

            • 3. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
              jaikiran

               

              "ALRubinger" wrote:
              May not work against GA, but does it work against current Plugin?

              This past week I'd added some more required MC "depends" during ServiceContainer start.

              S,
              ALR


              Let me give it a try with the plugin against the AS trunk.

              • 4. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
                jaikiran

                 

                "jaikiran" wrote:

                Let me give it a try with the plugin against the AS trunk.


                This fails on AS5 trunk, with a different exception (NPE):

                16:13:15,776 INFO [JBossASKernel] installing bean: tutorial:service=ServiceOne
                16:13:15,776 INFO [JBossASKernel] with dependencies:
                16:13:15,776 INFO [JBossASKernel] and demands:
                16:13:15,776 INFO [JBossASKernel] jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceOne,service=EJB3
                16:13:15,776 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
                16:13:15,776 INFO [JBossASKernel] and supplies:
                16:13:15,776 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneManagement
                16:13:15,776 INFO [JBossASKernel] jndi:ServiceOne/remote
                16:13:15,776 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneLocal
                16:13:15,776 INFO [JBossASKernel] Class:org.jboss.tutorial.service.bean.ServiceOneRemote
                16:13:15,776 INFO [JBossASKernel] jndi:ServiceOne/local-org.jboss.tutorial.service.bean.ServiceOneLocal
                16:13:15,776 INFO [JBossASKernel] jndi:ServiceOne/local
                16:13:15,777 INFO [JBossASKernel] jndi:ServiceOne/remote-org.jboss.tutorial.service.bean.ServiceOneRemote
                16:13:15,777 INFO [JBossASKernel] Installing bean(tutorial:service=ServiceOne) into kernel
                16:13:15,849 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:jar=jboss-ejb3-tutorial-service.jar,name=ServiceOne,service=EJB3 state=Configured
                java.lang.RuntimeException: Problem registering @Management interface for @Service class org.jboss.tutorial.service.bean.ServiceOne
                 at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:779)
                 at org.jboss.ejb3.service.ServiceContainer.create(ServiceContainer.java:251)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                 at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
                 at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                 at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
                 at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                 at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
                 at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
                 at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                 at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                 at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                 at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                 at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                 at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
                 at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
                 at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
                 at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                 at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                 at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                 at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                 at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
                 at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
                 at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
                 at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                 at java.lang.Thread.run(Thread.java:595)
                Caused by: java.lang.RuntimeException: javax.management.MBeanException
                 at org.jboss.ejb3.deployers.JBossASKernel.installMBean(JBossASKernel.java:181)
                 at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:757)
                 ... 54 more
                Caused by: javax.management.MBeanException
                 at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:219)
                 at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                 at org.jboss.ejb3.deployers.JBossASKernel.invokeOptionalMethod(JBossASKernel.java:287)
                 at org.jboss.ejb3.deployers.JBossASKernel.installMBean(JBossASKernel.java:176)
                 ... 55 more
                Caused by: javax.ejb.EJBException: java.lang.NullPointerException
                 at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
                 at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
                 at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:512)
                 at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:475)
                 at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:215)
                 ... 59 more
                Caused by: java.lang.NullPointerException
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
                 at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
                 at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                 at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                 ... 74 more
                


                The populateInvocation method is setting a null beanContext:

                protected StatefulContainerInvocation populateInvocation(StatefulContainerInvocation invocation)
                 {
                 invocation.setBeanContext(beanContext);
                 return invocation;
                 }
                

                When is the beanContext expected to be created?

                • 5. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
                  jaikiran

                   

                  "jaikiran" wrote:

                  This fails on AS5 trunk


                  I meant AS5.x branch

                  "jaikiran" wrote:
                  When is the beanContext expected to be created?


                  The @Management is being registered as part of the create() whereas the beanContext is being set (later) as part of start(). What is the right phase to create the beanContext?

                  • 6. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
                    alrubinger

                     

                    "jaikiran" wrote:
                    I meant AS5.x branch


                    Ah yes, Branch_5_x was made around the time I merged from trunk to Branch_5_0. I've now merged the JBossASKernel changes into Branch_5_x as well.

                    S,
                    ALR

                    • 7. Re: EJBTHREE-1669 : @Service tutorial on JBoss-5.0 GA
                      jaikiran

                      FYI - The "service" as well as "service_deployment_descriptor" tutorials both are now working against 5.0 GA as well as AS5.x branch after patching through the plugin.