EJB3 constructor throws an exception?

What happens if the EJB3 stateless / stateless constructor bean no args throws an exception? For example, class A has DI:

@EJB
B b;

      

and B throws an exception in the constructor? I didn't find any mention of this in the EJB3 specs. My guess is that the isntance of class A is discarded because it really doesn't have the means to accomplish its task.

+1


a source to share


3 answers


IME, if any of your EJBs fail to initialize while viewing the application, the application server knows there is a problem and does not put your application as available.



When this happens, your EJB / Web urls are not available ...

+1


a source


Typically a null pointer exception when trying to use b.



0


a source


javax.ejb.EJBTransactionRolledbackException

when you use method b.

0


a source







All Articles