-
1. Re: My error caught, TransactionRolledBackException thrown
jmiqueli Jan 28, 2002 10:18 AM (in response to odednoam)I am having the same problem. I'm using JBoss 2.4.4/catalina. I throw an error in my EJB but my container throws a TransactionRolledBackException. I need for my exception to be throwned. This did not happen in JBoss 2.4.2/tomcat.
-
2. Re: My error caught, TransactionRolledBackException thrown
sachin Jan 29, 2002 12:23 AM (in response to odednoam)Hi,
What i believe is that the container does not allow the code to throw Exceptions other than EJBException out of the container. With your EJB working in the container you will have to throw the EJBException out with whatever message string as parameter. You need to wrap you exception within the EJBException.
So:
try{
//you code
}catch(NullPointerException npe){ //for e.g.
throw new EJBException("NullPointerException");
}
Sachin -
3. Re: My error caught, TransactionRolledBackException thrown
seven Jan 29, 2002 12:23 PM (in response to odednoam)try to define a custom exception MyException extends java.lang.Exception and throw this one in your code. catch MyException in your servlet code and issue there rollback if it is the case. I mean the container rollsback the treansaction if u throw EJBException from your ejb code. read http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/BMP6.html for details
-
4. Re: My error caught, TransactionRolledBackException thrown
oravecz Feb 4, 2002 8:28 PM (in response to odednoam)That's not really the solution.
There must have been a bug that entered the codebase for the Tomcat bundle, when jBoss 2.4.4 was released. Application exceptions should be thrown to the client as the original application exception. This is not currently happening in the latest "stable" code base.
Has there been a patch issued yet? I can't find one. -
5. Re: My error caught, TransactionRolledBackException thrown
mulicheng Mar 22, 2002 1:25 PM (in response to odednoam)I agree that the the user defined exception should be thrown to the client. If I extend Exception, I can't get at the embedded error messages until way down the list of embedded exceptions. If I extend EJBException, I see my Exception embedded in the TransactionRolledBackException. Still not acceptable.
Has anyone found a fix to this? -
6. Re: My error caught, TransactionRolledBackException thrown
mulicheng Mar 27, 2002 2:16 PM (in response to odednoam)Upgrading to latest CVS fixed this problem for me.
-
7. Re: My error caught, TransactionRolledBackException thrown
oravecz Mar 27, 2002 4:00 PM (in response to odednoam)Which "latest CVS"? The 3.0 Head or the upcoming 2.4.5?
-
8. Re: My error caught, TransactionRolledBackException thrown
mulicheng Mar 27, 2002 6:14 PM (in response to odednoam)3.0 - I'm using 3.0.0beta2
-
9. Re: My error caught, TransactionRolledBackException thrown
oravecz Mar 27, 2002 7:21 PM (in response to odednoam)Strange....unless it was fixed in the last day or two, the problem still persists for me.