2 Replies Latest reply on Oct 1, 2007 9:38 AM by Pete Muir

    will ejb3 rePack my exception?

    sailor chibi Newbie

      it seems EJB will rePack my custom exception with EJBTransactionRolledbackException, then add a message "Transaction failed " in facesMessages()

      i have a EJB service like this:

      public void doSomething() throws ServiceException{
       try {
       something_to_do();
       } catch (Exception e) {
       throw new ServiceException("sorry, i can't do this");
       }
       }
      

      and i have a seam component use this service:
      public doSomethingWithEJB(){
       try {
       ejb.doSomething();
       } catch (ServiceException e) {
       log.info("he can't do that #0", e.getMessage());
       } catch (Exception e) {
       log.info("huh? he throws a new #0 Exception:#1 ", e.getClass(), e.getMessage());
       }
      }
      


      when service failed, i got this result:
      huh? he throws a new class javax.ejb.EJBTransactionRolledbackException Exception: sorry, i can't do this