3 Replies Latest reply on Feb 1, 2006 2:38 PM by dunks80

    ejb3 embeddable alpha 4 microcontainer deployment

    dunks80 Newbie

      I was wondering has anyone gotten the the micorcontainer deployment example (boss-EJB-3.0_Embeddable_ALPHA_4/docs/embedded-tutorial/advanced-deployment/microcontainer-deployment) to work? My tests started failing after i moved from alph3 to alph4 so i decided to check the example and it's failing with the same error...

      run:
       [java] FATAL 01-02 10:51:27,770 (PersistenceXmlLoader.java:parsePersistenceUnit:101) -custdb JTA
       [java] java.lang.RuntimeException: java.lang.NullPointerException
       [java] at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:90)
       [java] at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:608)
       [java] at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:452)
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
       [java] at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
       [java] at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;J)Ljava.lang.Object;(Unknown Source)
       [java] at org.jboss.joinpoint.plugins.reflect.ReflectMethodJoinPoint.dispatch(ReflectMethodJoinPoint.java:72)
       [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:96)
       [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:476) [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:171)
       [java] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       [java] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
       [java] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
       [java] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
       [java] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
       [java] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:82)
       [java] at org.jboss.tutorial.mcdeploy.Main.main(Main.java:39)
       [java] Caused by: java.lang.NullPointerException
       [java] at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
       [java] ... 23 more
       [java] Exception in thread "Main Thread" java.lang.RuntimeException: java.lang.IllegalStateException: Incompletely deployed:
      
       [java] *** DEPLOYMENTS IN ERROR:
       [java] EJBDeployment -> java.lang.RuntimeException: java.lang.NullPointerException
      
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:87)
       [java] at org.jboss.tutorial.mcdeploy.Main.main(Main.java:39)
       [java] Caused by: java.lang.IllegalStateException: Incompletely deployed:
      
       [java] *** DEPLOYMENTS IN ERROR:
       [java] EJBDeployment -> java.lang.RuntimeException: java.lang.NullPointerException
      
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:241)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:161)
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:83)
       [java] ... 1 more
       [java] ERROR 01-02 10:51:27,868 (AbstractController.java:incrementState:350) -Error installing to Start: name=EJBDeployment state=Create
       [java] java.lang.RuntimeException: java.lang.NullPointerException
       [java] at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:90)
       [java] at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:608)
       [java] at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:452)
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
       [java] at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
       [java] at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;J)Ljava.lang.Object;(Unknown Source)
       [java] at org.jboss.joinpoint.plugins.reflect.ReflectMethodJoinPoint.dispatch(ReflectMethodJoinPoint.java:72)
       [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:96)
       [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:476) [java] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:171)
       [java] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       [java] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
       [java] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
       [java] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
       [java] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
       [java] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
       [java] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
       [java] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
       [java] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:82)
       [java] at org.jboss.tutorial.mcdeploy.Main.main(Main.java:39)
       [java] Caused by: java.lang.NullPointerException
       [java] at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
       [java] ... 23 more
       [java] Java Result: 1
      


      I get the same exception when i try to deploy my own persistence units. Debugging through the code it seems that the kernel and server attribute of the org.jboss.ejb3.MCKernelAbstraction are never being set and so the call to kernel.getController().install(bean); bombs. Anyone have any ideas how this can be fixed? I"m not sure if it's a bug or simply a configuration issue.

      Thanks

        • 1. Re: ejb3 embeddable alpha 4 microcontainer deployment
          dunks80 Newbie

          I managed to fix this issue by extending org.jboss.ejb3.embedded.EJB3StandaloneDeployer and adding the following constructor...

          public class MyEJB3StandaloneDeployer extends org.jboss.ejb3.embedded.EJB3StandaloneDeployer
          {
           public MyEJB3StandaloneDeployer()
           {
           super();
           setKernel(EJB3StandaloneBootstrap.getKernel());
           }
          
          }
          


          Then in my ejb3-deployment.xml I mapped my deployments as follows...
           <bean name="EJBDeployment" class="MyEJB3StandaloneDeployer">
           <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
           <property name="archives" >
           <set class="java.util.HashSet" elementClass="java.net.URL">
           <value>file://my.peristence.jar</value>
           </set>
           </property>
           </bean>
          


          This way i could continue to book embedded ejb3 with the following code...

          ...
           EJB3StandaloneBootstrap.boot(null);
          EJB3StandaloneBootstrap.deployXmlResource("ejb3-deployment.xml");
          ...
          


          • 2. Re: ejb3 embeddable alpha 4 microcontainer deployment
            dunks80 Newbie

            I'm now facing another issue when deploying in the micorcontainer. My ejbs are not being mapped to 'ejbName/local' as I would expect but rather just 'ejbName'

            • 3. Re: ejb3 embeddable alpha 4 microcontainer deployment
              dunks80 Newbie

              Nevermind the jndi issue was my own fault