Yeah, I tracked it down the the start method of
EnvironmentClassLoader. When walking through the EnvironmentListener[]
list the webbeans (and @ApplicationScope @Service) are init'd before
the EJB system. The EntityManagerFactory exists in the AmberContainer
but it is still in the _pendingFactory list (and not in the wbManager
it seems) until the startPersistenceUnits method is called for

The list of listeners is in this order:
InjectManager (osgi)
WeakStopListener (@Stateless EJB instance)

Basically the @Service @PostConstruct is called during the first
InjectManager, and the Amber/Ejb Container isn't good till much later
(at the end).

Well, that is what it seems to be. I think I should be able to find a
workaround since it seems that there are events that fire after all
this that I can hook into. Not the most elegant way, but should work
for now (I can take care of re-initialization in case it changes
behavior). I don't know enough about the internals of resin to know if
this a problem, or fixable, but if I can help let me know :)

On Tue, Mar 31, 2009 at 3:25 PM, Scott Ferguson <> wrote:
> On Mar 31, 2009, at 12:51 PM, Scott Hernandez wrote:
> I've added a bug report for this at
> I didn't quite understand the situation.  The environment might not be
> properly setup at the @PostConstruct time for some reason.

resin-interest mailing list

Reply via email to