JBoss Community

Re: Unable to catch RuntimeException in client EJB

created by Jan Martiska in EJB3 - View the full discussion

I guess you cannot work around the fact that the exception will be wrapped. But you still can try to catch the wrapper exception and inspect it to see if the exception inside is your SecurityBreakException, can't you?

 

catch (EJBTransactionRolledbackException e) {
    if(e.getCause() instanceof SecurityBreakException) {
        SecurityBreakException ex = (SecurityBreakException)e.getCause();
        // parse the exception and show a meaningful message to user    
    }
}

Reply to this message by going to Community

Start a new discussion in EJB3 at Community