3 Replies Latest reply on Nov 6, 2003 2:44 PM by jochenwurster

    SOLUTION:JBoss 3.0 EJB 2.0 CMP-- ejbCreate() throws null poi

    Benjamin Chi Newbie

      I'm using JBoss 3.0 Nov 23 build for EJB 2.0 CMP.
      I was getting an null pointer exception when creating a Entity bean. The solution was to overwrite the toString() method in the EntityPK class to return the value of the PrimaryKey.

      It seems like JBoss can't use simple primary key, JBoss must use a PrimaryKey class.

        • 1. Re: SOLUTION:JBoss 3.0 EJB 2.0 CMP-- ejbCreate() throws null
          Benjamin Chi Newbie

          I found that the descriptor for the session bean and entity bean needs the default transaction type to be "Required" otherwise the null pointer will be thrown.

          • 2. Re: SOLUTION:JBoss 3.0 EJB 2.0 CMP-- ejbCreate() throws null
            Allen Fogleson Newbie

            Actually i have been using simple primary keys in my entity beans under 3.0. (BigDecimal and String mostly)

            So this is interesting, I believe your second solution probably is more correct than Jboss having an inability to use Simple PK's.

            Al

            • 3. Still in 3.2.1
              jochenwurster Newbie

              Hello,

              this error seems to be still present in JBoss 3.2.1. The ejbCreate() method fails with a null pointer.

              I tried to set the transaction type to "Required"but with no effect.

              So what can i do to solve this problem?

              Bye Jochen

              -----
              javax.ejb.TransactionRolledbackLocalException: null; CausedByException is:
              null
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:204)
              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
              at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
              at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
              at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
              at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
              at org.jboss.ejb.Container.invoke(Container.java:694)
              at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:272)
              at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
              at $Proxy232.create(Unknown Source)
              at de.architur.fbi.beans.session.SubmitBugBean.submitBug(SubmitBugBean.java:89)