[jboss-jira] [JBoss JIRA] Commented: (JBAS-9267) @EJB with lookup = java:comp in a Servlet leads to incorrect service dependency creation

jaikiran pai (JIRA) jira-events at lists.jboss.org
Sat Apr 9 02:33:33 EDT 2011


    [ https://issues.jboss.org/browse/JBAS-9267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594602#comment-12594602 ] 

jaikiran pai commented on JBAS-9267:
------------------------------------

https://github.com/jaikiran/jboss-as/commits/ejb3 needs to be pulled upstream

> @EJB with lookup = java:comp in a Servlet leads to incorrect service dependency creation
> ----------------------------------------------------------------------------------------
>
>                 Key: JBAS-9267
>                 URL: https://issues.jboss.org/browse/JBAS-9267
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: EE
>    Affects Versions: 7.0.0.Beta2
>         Environment: AS7 upstream (April 7 2011)
>            Reporter: jaikiran pai
>            Assignee: jaikiran pai
>             Fix For: 7.0.0.Beta3
>
>
> Consider this servlet:
> {code}
> public class MyServlet extends HttpServlet {
>   @EJB(name="ejb/myBean")
>   private MyBeanIntf bean;
>   @EJB(lookup="java:comp/env/ejb/myBean")
>   private MyBeanIntf beanAgain;
> ...
> {code}
> 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:
> {code}
> jboss.naming.context.java.comp.appName.moduleName.moduleName.env/ejb/myBean 
> {code}
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list