9 Replies Latest reply on Oct 28, 2011 1:21 PM by lmcdasi

    @EJB(lookup) fails while context.lookup() is successfull

    lmcdasi

      I have a war file that has an EJB. @EJB(lookup="java:global/test-war/LcExample!<mypkg>.example.api.ILcExample") fails to do the injection while initialContext.lookup("java:global/test-war/LcExample!<mypkg>.example.api.ILcExample") returns the ejb object.

       

      I am wondering what do I do wrong or how it is suppose to work by using @EJB. The war content is :

       

          0 Thu Oct 20 10:10:48 EDT 2011 META-INF/

         126 Thu Oct 20 10:10:46 EDT 2011 META-INF/MANIFEST.MF

           0 Thu Oct 20 10:10:48 EDT 2011 WEB-INF/

           0 Thu Oct 20 10:10:48 EDT 2011 WEB-INF/classes/

           0 Thu Oct 20 10:10:48 EDT 2011 WEB-INF/classes/com/

           0 Thu Oct 20 10:10:48 EDT 2011 WEB-INF/classes/com/.../

           0 Thu Oct 20 10:10:48 EDT 2011 WEB-INF/lib/

           0 Thu Oct 20 10:10:48 EDT 2011 css/

           0 Thu Oct 20 10:10:48 EDT 2011 docs/

           0 Thu Oct 20 10:10:48 EDT 2011 images/

         448 Thu Oct 20 10:01:02 EDT 2011 WEB-INF/jboss-web.xml

        1297 Thu Oct 20 09:44:42 EDT 2011 WEB-INF/web.xml

        6756 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../FmHandler.class

        2528 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../CmListener.class

        5730 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../CmHandler.class

        1152 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../LicHandler$SentinelLicenses.class

        4534 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../LicHandler.class

        3633 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../PmHandler.class

        6470 Thu Oct 20 10:10:46 EDT 2011 WEB-INF/classes/com/.../Example.class   <<-- If I do the @EJB on the Example class that exteds HttpServlet then here the @EJB works without no lookup need it.

      12067 Thu Oct 20 10:10:44 EDT 2011 WEB-INF/lib/mgmt-ejb-P1A01.jar              << -- EJB ifc

        1390 Thu Oct 20 09:44:42 EDT 2011 css/test.css

        3102 Thu Oct 20 09:44:42 EDT 2011 docs/cm.html

        7051 Thu Oct 20 09:44:42 EDT 2011 docs/fm.html

        6180 Thu Oct 20 09:44:42 EDT 2011 docs/lc.html

        4034 Thu Oct 20 09:44:42 EDT 2011 docs/lm.html

        3439 Thu Oct 20 09:44:42 EDT 2011 docs/pm.html

        1929 Thu Oct 20 09:44:42 EDT 2011 images/logo.gif

        8841 Thu Oct 20 09:44:42 EDT 2011 index.jsp