Throw CreateException in Stateless sbean's ejbCreate


EJB programming & troubleshooting: Throw CreateException in Stateless sbean's ejbCreate

  1. I just wonder what would happen if I throw CreateException in a stateless session bean's (slsb) ejbCreate(). Recall that slsb's ejbCreate() is called by container when it create bean pool and has nothing to do with the client callling create().

    The problem is, according to the spec, the container should propagate the CreateException - which is considered just an application exception - back to the client. But which client should the container received it?

    The same problem applies to RemoveException in ejbRemove() too.
  2. Simple, Your container is the client in this case(invoking create method), So it will be reported in your container's log file or console. :)