It looks like your session bean is already running in the transaction context (is it a CMT session bean). This context gets propogated to all plain java objects that this session bean communicates with.
That's why when your plain java object tries to run in its own context (i.e. UserTransaction#begin()) your app server throws an error.
To fix the problem do one of the following:
1) make your plain java object run in the same context as the calling bean - it means that you do not need any transaction related code in your class (i.e. no reference to UserTransaction). Obviously, for this to work make sure that your bean has a transaction context.
If it is a BMT sb then:
If it is a CMT sb then ensure that your session bean's method(s) trans-attribute is one of the following: Required/RequiresNew/Mandatory. It will ensure that your session bean method always in the transaction context.
Hope it helps,
[ October 21, 2004: Message edited by: Alex Sharkoff ] [ October 21, 2004: Message edited by: Alex Sharkoff ]
Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
Paddy spent all of his days in the O'Furniture back yard with this tiny ad: