Community

Unexpected behaviour when binding to java:comp and @Startup beans

created by Marius Bogoevici in EJB 3.0 Development - View the full discussion

So, for Weld-int  we bind a BeanManager to java:comp/BeanManager. In order to make it accessible to EJBs, the binding procedure works like this:

 

1) Obtain the JavaEEComponent which corresponds to the EJBs DU

2) From the JavaEEComponent, obtain the Context (which represents java:comp for said component)

3) Bind the BeanManager

As a bit of background, one of the interceptors that are applied to CDI-enabled EJBs is injected with a @Resource("java:comp/BeanManager")

 

 

This works fine, as long as the EJB is not a @Startup  bean. For the latter, the lookup that is performed during EJBContainer.startup() seems to miss the JavaEEComponent (debugging ComponentObjectFactory shows that CurrentComponent.get() returns null and thus JavaEEComponent is ignored - so that the BeanManager that is bound to JavaEEComponent's context is not found).

 

So, I'm looking forward to some clarifications concerning this - mainly to discuss what's the best way to move forward:

 

a) open a JIRA, fix the issue, or

b) use the SwitchBoard

 

Thanks,

Marius

 

Message was edited by: Marius Bogoevici, typo in title

Reply to this message by going to Community

Start a new discussion in EJB 3.0 Development at Community