-
1. Re: EJBExceptions in business methods
drcharris Jun 9, 2003 11:24 AM (in response to mutilin)Yes, it is spec-compliant.
In a J2EE server there are two kinds of exceptions
1. System Exceptions
2. Application Exceptions
System exceptions are all RuntimeExceptions (and subclasses, this includes EJBException), and RemoteException. If a method throws one of these then the container is obliged to remove the bean instance in which the exception was thrown. The logic here is that, since the exception is unchecked, youve got no real way of recovering from it and therefore the state of your bean instance could be corrupted.
Application exceptions are propagated just like any other, and don't destroy the bean instance.
If there's a chance of you recovering from the exception your method is throwing, then you should make it a checked exception and not EJBException.
The error message you're getting is JBoss trying to activate the bean instance (probably a stateful session bean) in a subsequent call and failing because the bean instance no longer exists.