Hi,
I have written a very small test system (HTML page, servlet, stateless
session bean). The HTML calls the servlet, the servlet gets the home
interface of the SSB then calls getMessage() on the SSB which, yes you
guessed it) returns "Hello World".
This all works fine, so I then decided to investigate CreateException, so I
made the SSB create() method just throw a CreateException. I see my debug
message saying that CreateException is about to be thrown, but it turns up
in the servlet as a RemoteException (Strange Behaviour 1) ONLY after I call
getMessage() on the SSB (Strange Behaviour 2). If I don't call getMessage()
I don't get the exception!
Two questions, first why is CreateException being re-thrown as
RemoteException, my reading of the specification (EJB.9.1.9.1 and
EJB.12.3.1) lead me to believe that it should be re-thrown as
CreateException. Both the create() method in the home interface and
ejbCreate() method in the implementation have CreateException in their
throws clause.
Second, why am I not seeing the exception until I call getMessage() on the
SSB. Is this a lazy instantiation optimisation by my provider?
Regards,
David
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".