aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Help with CMP implementation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Help with CMP implementation." Watch "Help with CMP implementation." New topic
Author

Help with CMP implementation.

Nandakumar Subramaniam
Greenhorn

Joined: Aug 11, 2004
Posts: 4
Hi all,

I am in the process of learning EJB from the scratch. I am also preparing for SCBCD in the process. I wrote a CMP bean to insert a row of data into the database. I am using the j2ee RI to deploy my bean.

I have written the RemoteComponent interface, Home interface and the bean. I have successfully deployed it too using the deploytool in j2ee. The database i use is the default Cloudscape.

I get the following error when i try to call create on the Home object ..

home.create(.....);

this gives out a transactionRollBackException.

Can any one kindly help me on how to get over this issue ?

The stack trace is given below.

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback; nested exception is:
javax.transaction.RollbackException: Transaction marked for rollback
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:64)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at com.uforians.ejb._UforianHome_Stub.create(Unknown Source)
at com.uforians.client.UforianClient.main(UforianClient.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.rmi.RemoteException: Transaction aborted (possibly due to transaction time out).; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback; nested exception is:
javax.transaction.RollbackException: Transaction marked for rollback
at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:389)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:431)
at com.uforians.ejb.UforianBean_PM_RemoteHomeImpl.create(UforianBean_PM_RemoteHomeImpl.java:40)
at com.uforians.ejb._UforianBean_PM_RemoteHomeImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:520)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:210)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:255)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
Caused by: javax.transaction.RollbackException: Transaction marked for rollback
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:161)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:243)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:1485)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:1289)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:403)
... 8 more
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Nandakumar,
A transaction rollback exception usually means that there was some problem inserting the row into the database. Check you are setting all non-null fields, there are no duplicate keys and that you aren't violating any constraints.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with CMP implementation.