[jboss-user] [JBoss Microcontainer] - When is a bean moved to STARTED state?

jaikiran pai do-not-reply at jboss.com
Tue Mar 30 13:42:21 EDT 2010

jaikiran pai [http://community.jboss.org/people/jaikiran] created the discussion

"When is a bean moved to STARTED state?"

To view the discussion, visit: http://community.jboss.org/message/534716#534716

This question relates to a thread in JBoss AS forum where a user is running into error trying to setup a dependency between a web application and an EJB  http://community.jboss.org/message/534413#534413 http://community.jboss.org/message/534413#534413

Here's a brief overview:

1) A web app adds a < depends> in its jboss-web.xml to mark a dependency on a EJB container (which is a MC bean). The web app internally looks up the bean from JNDI and hence this dependency.
2) The EJB container (MC bean) has a "start()" lifecycle callback method (among other similar lifecycle callbacks).
3) In its start(), the EJB container *first* deploys some other MC beans and *then* binds the EJB proxies to JNDI.

When EJB container deploys some other MC beans in step#3, it results in MC resolving dependencies of other unrelated beans (known issue). Incidentally, while doing so, MC considers that the EJB container MC bean has been started even though the start() lifecycle method hasn't yet finished. MC then goes on to push the web-app to its next state considering the dependency has been fulfilled (which hasn't yet been fulfilled because the JNDI bindings in step#3 are not yet done). This results in the web-app running into NameNotFoundExceptions.

Does MC set the state to START even before the start() lifecycle successfully completes?


Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100330/1630517b/attachment.html 

More information about the jboss-user mailing list