wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Getting javax.ejb.RemoveException  in stateful exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Getting javax.ejb.RemoveException  in stateful exception" Watch "Getting javax.ejb.RemoveException  in stateful exception" New topic
Author

Getting javax.ejb.RemoveException in stateful exception

SampathKumar chinnadurai
Ranch Hand

Joined: Jul 05, 2006
Posts: 44
I'm working on a maintenance project . In this project, There is a stateful bean with the name "RegistrarManagerBean" and the component interface name is "LocalRegistrarManager".

There are some business logic after executing the business logic the following finally block has been called .




After executing this line " localRegistrarManager.remove()", it throws the following error

javax.ejb.RemoveException: Cannot remove EJB: transaction in progress.


Actually there is no business logic after this line .Could you please some one let me know how to fix this issue .


Cleared SCJP 6 (87%), SCWCD 5 (94%), SCBCD 5.0(95%), PMP ,preparing SCDJWS ,OCUP
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

I guess there should be a business logic BEFORE this line and not after? Are you sure your SFSB doesn't use bean managed transaction demarcation and there isn't any active transaction which spans on several business methods?

Cheers!


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
SampathKumar chinnadurai
Ranch Hand

Joined: Jul 05, 2006
Posts: 44
Thanks Pedro,

yes , There are some business logic before the finally block. yes , we are using the bean managed transaction demarcation. These methods have been completed before calling the finally block .

Is it possible to call the below code to find the transaction and forcefully rollback it . Is there any other way we can avoid the exception(RemoveException)?


I got this code from following url StatefulSessionContainer


Please provide your thoughts .



Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

And before the 'finally' block in @Remove method (or from one of your business methods) you did committed the transaction using UserTransaction#commit()?
SampathKumar chinnadurai
Ranch Hand

Joined: Jul 05, 2006
Posts: 44
The EJB version is 2.0. we have not used the @ Remove . but before the finally block all the transactions have been committed . i understand that somewhere its missing , we did not commit the transaction.

This is a large project , so i'm not able to locate the exact transaction .

Is there any way i can stop the exception. This exception creates big problem in the production .
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Sorry, I'm not familiar with EJB 2.0...

So you did not try to commit the transaction - can you just get the current transaction from within the method (I guess you can get it from the SessionContext?), commit it (or rollback it) and see the results?

Sorry I can't be of any help - maybe someone with better knowledge could help you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting javax.ejb.RemoveException in stateful exception
 
Similar Threads
MDB + Entity Bean / MDB + SB + EB
long post IBM.158
To Nikhil Pendharkar for IBM 287
IBM 287 ICE TEST
Answers of Sun's Free Proficiency Assessment