1 Reply Latest reply on Dec 4, 2003 8:06 AM by Adrian Brock

    NullPointerException getting ejb-ref on MDB startup

    eoin Newbie

      My MDB uses entity beans. If there are messages in the queue when the ear is deployed, i get exceptions like:

      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:513)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
      at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:293)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:184)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:68)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:133)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy16.findByPrimaryKey(Unknown Source)

      from the onMessage method.

      I have seen other posts mentioning this, with responses saying that the entity bean has not fully deployed.

      I do have ejb-local-ref entries for the mdb to the entity bean in the ejb-jar.xml file.

      Is there something i can do to have the message bean not started processing messages until the entities are ready to use?

      I am using jboss 3.0.8 on java 1.4.2 / linux.

      regards,

      eoin.