This is very interesting indeed - I checked the book and the spec, and there seems to be no simple explanation for this! Maybe the container creates an EJB-object for each stateless session bean before calling ejbCreate() anyway (or uses the same EJB object for each stateless bean from the same home?), or there's a mistake in the spec.
BTW: this is not the only problem in the spec, there is more like this in "operations allowed" sections (related to transactional context and allowed methods).
Originally posted by Sujay Kamble:
In Headfirst EJB on Page 228 , its mentioned that u can use the sessionContext.getEJBObject() in the ejbCreate method of a stateless session bean.
But a stateless session bean is linked to its EJBObject only when a client invokes a business method on the remote interface (HeadFirst Page 226 point #2).
Then how is it possible to get a reference to the EJBObject in the ejbCreate of a stateless session bean.
Sujay.