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
AmberContainer.

The list of listeners is in this order:
InjectManager
OsgiLoader
InjectManager (osgi)
DBPoolImpl
EjbContainer
AmberContainer
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 <f...@caucho.com> wrote:
> On Mar 31, 2009, at 12:51 PM, Scott Hernandez wrote:
> I've added a bug report for this at http://bugs.caucho.com/view.php?id=3429
>
> 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
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to