0 Replies Latest reply on Oct 4, 2001 9:05 AM by Parshuram Walunjkar

    TRANSACTION ROLLBACK EXCEPTION:null

    Parshuram Walunjkar Newbie

      Hi all,
      I am trying to use Composite primary key in CMP Beans With JBoss And Tomcat .When I call create method it gives me the following exception............

      Kindly suggest the reasons and solutions.

      server output.........
      [PIDETAIL] TRANSACTION ROLLBACK EXCEPTION:null
      Embedded Exception
      null; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      null
      [PIDETAIL] java.lang.NullPointerException
      [PIDETAIL] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEn
      tityCommand.java:111)
      [PIDETAIL] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPersisten
      ceManager.java:128)
      [PIDETAIL] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManag
      er.java:231)
      [PIDETAIL] at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:616)
      [PIDETAIL] at java.lang.reflect.Method.invoke(Native Method)
      [PIDETAIL] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
      r.java:843)
      [PIDETAIL] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
      hronizationInterceptor.java:231)
      [PIDETAIL] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
      erceptor.java:154)
      [PIDETAIL] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
      .java:108)
      [PIDETAIL] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)

      [PIDETAIL] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
      java:307)
      [PIDETAIL] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
      [PIDETAIL] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
      a:103)
      [PIDETAIL] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
      [PIDETAIL] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420)
      [PIDETAIL] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai
      nerInvoker.java:370)
      [PIDETAIL] at java.lang.reflect.Method.invoke(Native Method)
      [PIDETAIL] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      [PIDETAIL] at sun.rmi.transport.Transport$1.run(Transport.java:142)
      [PIDETAIL] at java.security.AccessController.doPrivileged(Native Method)
      [PIDETAIL] at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
      [PIDETAIL] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
      [PIDETAIL] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
      43)
      [PIDETAIL] at java.lang.Thread.run(Thread.java:484)


      And I am having such xml descriptors as follows

      This is my ejb-jar xml.......
      -----------------------------------ejb-jar.xml--------------------------------------------
      <ejb-jar>
      <enterprise-beans>

      <ejb-name>PIDETAIL</ejb-name>
      examples.trial.detail.PIDetailHome
      examples.trial.detail.PIDetail
      <ejb-class>examples.trial.detail.PIDetailBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>examples.trial.detail.PIDetailPK</prim-key-class>
      False
      ...................
      ...................


      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>

      <ejb-name>PIDETAIL</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>
      -------------------------------------------- --------------------------------------------

      And my jaws.xml file as follows ...................

      --------------------------------------------jaws.xml------------------------------------------

      java:/OraclePool
      <enterprise-beans>

      <ejb-name>PIDETAIL</ejb-name>
      <table-name>PU_PO_DETAIL</table-name>
      <create-table>true</create-table>
      <cmp-field>
      <field-name>poNo</field-name>
      <column-name>PONO</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>po_Srno</field-name>
      <column-name>PO_SRNO</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>revision_No</field-name>
      <column-name>REVISION_NO</column-name>
      </cmp-field>
      ...................
      ...................

      <primkey-field>poNo</primkey-field>
      <primkey-field>po_Srno</primkey-field>
      <primkey-field>revision_No</primkey-field>

      </enterprise-beans>

      -----------------------------------------------------
      Thease are my composite key.
      PoNo, po_Srno, revision_No.

      ---------------------------PK class ---------------
      package examples.trial.detail;
      import java.io.*;
      public class PIDetailPK implements Serializable
      {
      public String poNo;//fk
      public int po_Srno; //pk
      public int revision_No;//fk

      public PIDetailPK()
      {
      }
      public PIDetailPK(String poNo,int po_Srno,int revision_No)
      {
      this.poNo = poNo;
      this.po_Srno = po_Srno;
      this.revision_No = revision_No;
      }
      public boolean equals(Object ThisKey)
      {
      if( ThisKey == null | | !(ThisKey instanceof PIDetailPK) )
      return false ;
      PIDetailPK pk = (PIDetailPK)ThisKey ;
      if( (this.poNo.equals(pk.poNo)) && (this.revision_No == pk.revision_No) && (this.po_Srno == pk.po_Srno))
      return true ;
      return false ;
      }
      public int hashCode()
      {
      return ((this.toString()).hashCode()) ;
      }
      public String toString()
      {
      StringBuffer sb = new StringBuffer();
      sb.append(poNo);
      sb.append(revision_No);
      sb.append(po_Srno);
      return (sb.toString());
      }
      }
      *************************************** **************