1 Reply Latest reply on Jan 12, 2005 5:52 PM by Saravanan Balasubramanian

    JDBCLoadRelationCommand producing NullPointerException

    Saravanan Balasubramanian Newbie

      Hi,

      My application works under JBoss 3.2.1 but fails under JBoss 4.0. I receive the following error:

      2005-01-11 17:59:31,078 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.MediaEJB] load relation SQL: SELECT media_id, id FROM audio with (xlock) WHERE (media_id=?) OR (media_id=?)
      2005-01-11 17:59:31,078 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void com.harris.has.content.ejb.MediaEJB.update(com.harris.has.model.content.Media), causedBy:
      java.lang.NullPointerException
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.execute(JDBCLoadRelationCommand.java:147)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadRelation(JDBCStoreManager.java:695)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.load(JDBCCMRFieldBridge.java:1295)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBridge.java:649)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getValue(JDBCCMRFieldBridge.java:602)
       at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler$FieldGetInvoker.invoke(EntityBridgeInvocationHandler.java:133)
       at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:91)
       at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:62)
       at com.harris.has.content.ejb.MediaEJBBean$Proxy.getAudioEJB(<generated>)
       at com.harris.has.content.ejb.MediaEJBBean.update(MediaEJBBean.java:233)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ........
      



      Here is the relationship between MediaEJB and AudioEJB.

       <ejb-relation>
       <ejb-relation-name>mediaEJB-audioEJB</ejb-relation-name>
       <ejb-relationship-role>
       <description>mediaEJB</description>
       <ejb-relationship-role-name>MediaEJBRelationshipRole</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source>
       <description>mediaEJB</description>
       <ejb-name>MediaEJB</ejb-name>
       </relationship-role-source>
       <cmr-field>
       <description>audioEJB</description>
       <cmr-field-name>audioEJB</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
       <ejb-relationship-role>
       <description>audioEJB</description>
       <ejb-relationship-role-name>AudioEJBRelationshipRole</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <cascade-delete />
       <relationship-role-source>
       <description>audioEJB</description>
       <ejb-name>AudioEJB</ejb-name>
       </relationship-role-source>
       <cmr-field>
       <description>mediaEJB</description>
       <cmr-field-name>mediaEJB</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
       </ejb-relation>
      


      Any ideas on what the problem could be?

      Thanks,
      Bala