A surprising exception when call the EJB

OS:Windows-2000

J2EE-Server:J2sdkee1.2.1

Database:SQLServer-2000

The CMP-beanUserEJB has been deployed successfully.

Main client program:

UserHome userHome=(UserHome)PortableRemoteObject.narrow(objectRef,ejb.UserHome.class);

User user=userHome.create(userid,password,name);

When running the client program,exception occured like this:

java.rmi.ServerException: RemoteException occurred in server thread; nested exce

ption is:

java.rmi.RemoteException: Transaction aborted (possibly due to transacti

on time out).; nested exception is:

javax.transaction.RollbackException

java.rmi.RemoteException: Transaction aborted (possibly due to transaction time

out).; nested exception is:

javax.transaction.RollbackException

javax.transaction.RollbackException

<<no stack trace available>>

But a new data-row has been inserted into the table successfully.

What on earth caused that? And how to solve this problem?

Any reply is welcome.Thanks!

[1072 byte] By [youniea] at [2007-9-28 6:06:34]
# 1

I have only a partial solution (if you find it all I'll be happy to know myself...)

I had the same problem. It occurs that the problem is related to the definitions of transactions attributes in the table of the transaction tab. go to this tab and change the attribute from "required" to "supported" (I assume you have "required" and it should not be) in the method which causes the exception.

hope this helped.

henbitana at 2007-7-9 17:17:36 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Thanks a lot! I think your advice is very useful to me.Before this,I solve the problem just by removing the transaction declare in the ejb-jar.xml.Of course,that is not very reasonable.But I still think that maybe it is a bug of J2sdkee.
youniea at 2007-7-9 17:17:36 > top of Java-index,Other Topics,Patterns & OO Design...