I'm trying to upgrade my ear from glassfish 2 to glassfish 3. We used to have our session beans and our entities all in one jar file. I've learned that I need to put these in separate jar files to be able to deploy to glassfish 3. The way I did this was by creating a new jar and moved the session beans, the ejb-jar.xml
, persistence.xml
and sun-ejb-jar.xml
in them. The session bean lib has the old lib as a dependency. The old lib still contains the custom Exception
classes we've used and entities and pretty much everything else that used to be there.
But what I've notice from an integration test is that when exceptions get thrown, the transactions don't get rolled back like they used to. I'm still deploying to GF2 right now. Other than this subtle problem, everything appears to be working. How do I fix this issue? Do I need to move these Exception
classes into the session bean jar?
Here's an example of what one of these exceptions looks like:
@ApplicationException(rollback=true)
public class MessageOutOfOrderException extends ConditionException { //this is the one that gets thrown
//...
}
@ApplicationException(rollback=true)
public class ConditionException extends Exception { //this is the parent. It also gets thrown directly sometimes
//...
}