3 Replies Latest reply on Jun 17, 2004 1:12 AM by ittay

    NullPointerException from jboss while loading a CMR

    ittay

      this is the stack trace, not much more i can say, because there is not specific scenario in which this happens.

      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.getFieldState(JDBCCMP2xFieldBridge.java:124)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.setInstanceValue(JDBCCMP2xFieldBridge.java:221)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.setInstanceValue(JDBCCMP2xFieldBridge.java:159)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:325)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:190)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:83)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:632)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBridge.java:565)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getValue(JDBCCMRFieldBridge.java:508)
      at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:124)
      at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
      at com.qlusters.qrm.server.model.virtualserver.ejb.VirtualServerStatisticsCMP$Proxy.getState()

        • 1. Re: NullPointerException from jboss while loading a CMR
          triathlon98

          This can typically occur when you are trying to access a field of primitive type (int, double) when there are null values in the database. As this can't be represented at the CMP level, you run into problems.

          A possible solution is to define your fields as Integer or Double.

          Joachim

          • 2. Re: NullPointerException from jboss while loading a CMR
            rag

            Dear friend,
            whenever you are deploying an entity bean that has referntial integrity at database level (primary key-foreignkey relationship) see that you have defined both Home, Localhome & Remote, Local Component interfaces in both the entity bean.
            and make sure that they are mentioned in the ejb-jar.xml
            like this:
            <ejb-class>taxentitybean.TaxEJB</ejb-class>
            taxentitybean.TaxHome
            taxentitybean.Tax
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            with regards
            Akhil

            • 3. Re: NullPointerException from jboss while loading a CMR
              ittay

              can you explain why i should put the home and interface in the <ejb-class> section?

              do you know how i can do it with xdoclet?

              thanx,
              ittay