Details
-
Bug
-
Resolution: Done
-
Major
-
7.0.0.Beta2
-
None
Description
Consider this servlet:
public class MyServlet extends HttpServlet { @EJB(name="ejb/myBean") private MyBeanIntf bean; @EJB(lookup="java:comp/env/ejb/myBean") private MyBeanIntf beanAgain; ...
This leads to a failed deployment due an incorrect service dependency creation, which ultimately leads to a missing dependency.
The injection target beanAgain sets up a binding description whose source ends up adding a dependency on:
jboss.naming.context.java.comp.appName.moduleName.moduleName.env/ejb/myBean
Notice that it adds a dependency on java:comp naming context. But since servlets (web module) runs under a java:module context, this service dependency is never satisfied.
The LookupBindingSourceDescription should take into account the ComponentNamingMode and the lookup jndi name value (i.e. check for java:comp) before creating the correct service dependency.