- 
        1. Re: Wrong exception is thrown during entity's ejbCreate()petertje Oct 2, 2002 5:21 AM (in response to sergeibatiuk)> public Integer ejbCreate(DepartmentData dd) throws 
 > s CreateException, ValidateException {
 > try {
 > validate();
 > this.setData( dd );
 > return null;
 >
 > }
 > catch( Exception ex ) {
 > throw new CreateException( ex.toString() );
 > }
 > }
 > ..
 > }
 >
 > the validate() method throws ValidateException if
 > validation fails. However, the exception caught by
 > DepartmentManager is not ValidateException, as
 > expected, but javax.ejb.EJBException instead:
 That is because you catch the ValidateException and convert it into a CreateException yourself...??
- 
        2. Re: Wrong exception is thrown during entity's ejbCreate()sergeibatiuk Oct 3, 2002 7:27 AM (in response to sergeibatiuk)Thanks very much peterje! 
 Sometimes the more stupid the mistake, the harder it is to find! I think I never felt that stupid before...
 I added the
 }
 catch( ValidateException ex ) {
 throw ex;
 }
 and everything works perfectly, as it should!
 Thanks,
 Sergei Batiuk.
- 
        3. Re: Wrong exception is thrown during entity's ejbCreate()sergeibatiuk Oct 3, 2002 7:28 AM (in response to sergeibatiuk)Thanks very much peterje! 
 Sometimes the more stupid the mistake, the harder it is to find!
 I added the
 }
 catch( ValidateException ex ) {
 throw ex;
 }
 and everything works perfectly, as it should!
 Thanks,
 Sergei Batiuk.
 
    