tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afryer <apfr...@hotmail.com>
Subject Re: Accessing an EJB by name from a servlet init method fails in collapsed ear if <load-on-startup> is specified for the servlet
Date Mon, 08 Aug 2011 04:02:32 GMT
Can you refer me to the spec where it says the environment naming context
should not be accessible in callbacks like @PostConstruct?  I'm searching
through the javaee_platform_6_0-fr-spec.pdf and servlet-3_0-pfd-spec.pdf and
can't find mention of that.  In fact i think it says @PostConstruct gets
called when after the class constructor and after all resources have been
injected, implying that the environment naming context would be populated at
that point.  Although its possible i'm missing something because I haven't
read the spec with a fine tooth comb and it doesn't seem to explicitely
detail the lifecycle, my impression is that the environment should be
populated before the servlet init method is called.

javaee_platform-6_0-fr-spec.pdf...


> *EE.5.3.4 Java EE Product Provider’s Responsibilities*
> The Java EE Product Provider has the following responsibilities:
> ...
> •Implement the java:comp, java:module, java:app and java:global
> environment naming contexts, and provide them to the application component
> instances at runtime. The naming context must include all the entries
> declared by the Application Component Provider, with their values supplied
> in the deployment descriptor or set by the Deployer. The environment
> naming context must allow the Deployer to create subcontexts if they are
> needed by an application component. Certain entries in the naming context
> may have to be initialized with the values of other entries, specifically
> when the “lookup” facility is used. In this case, it is an error if there
> are any circular dependencies between entries. Similarly, it is an error
> if looking up the specified JNDI name results in a resource whose type is
> not compatible with the entry being created. The deployment tool may allow
> the deployer to correct either of these classes of errors and continue the
> deployment.
> 

--
View this message in context: http://openejb.979440.n4.nabble.com/Accessing-an-EJB-by-name-from-a-servlet-init-method-fails-in-collapsed-ear-if-load-on-startup-is-spet-tp3604528p3726049.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message