2 Replies Latest reply on Oct 28, 2008 10:35 AM by aloubyansky

    NPE in JDBCStoreManager

    starksm64

      With the conf/jboss-service.xml refactoring, I'm seeing the following NPE for some tests (org.jboss.test.hello.test.HelloTimingStressTestCase).

      00:28:25,855 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:module="hello.jar",service=EjbModule state=Create mode=Manual requiredState=Installed
      java.lang.NullPointerException
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:415)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)
       at org.jboss.ejb.EjbModule.startService(EjbModule.java:511)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
      ...
      


      It looks like the EjbModule is starting the pm before the entity container has been started. Why don't we start the pm from the EntityContainer.startService?


        • 1. Re: NPE in JDBCStoreManager
          starksm64

          The reason the container is not getting started is due to the dependency on the http-invoker:

          2008-10-20 00:57:25,599 DEBUG [org.jboss.system.ServiceController] (RMI TCP Connection(6)-127.0.0.1) Waiting in create of jboss.j2ee:jndiName=helloworld/HelloLogHTTP,service=EJB on jboss:service=invoker,type=http
          


          • 2. Re: NPE in JDBCStoreManager
            aloubyansky

             

            "scott.stark@jboss.org" wrote:
            It looks like the EjbModule is starting the pm before the entity container has been started. Why don't we start the pm from the EntityContainer.startService?


            It's dictated by the current logic behind the (CMP) persistence manager start:
            - first every persistence manager in the EJB module performs its initStoreManager();
            - then after all of them initialized, they can be started which includes resolution of CMR and foreign keys (which is the reason why they are started in this way).

            So, calling start on one of the PMs won't actually start the PM. Only when the last PM in the EJB module receives the start call they get started.
            So, if the PM.start() were in EntityContainer.startService() then after return from EntityContainer.startService(), the container's PM might not had been started and the container would not be usable.