Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-598

org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod.SessionBeanStaticObserverMethodInvocationContextTest failing due to discrepancy between platform and ejb specs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.1.0.Final, 2.0.4.Final
    • 2.0.2.Final
    • Tests
    • None

      org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod.SessionBeanStaticObserverMethodInvocationContextTest is failing in GlassFish because of the lookup of the ejbs in java:comp in FooObserver. Here's the code in FooObserver#init around line 58:

      toner = (Toner) InitialContext.doLookup("java:comp/Toner");
      printer = (Printer) InitialContext.doLookup("java:comp/Printer");

      I have debugged it and the reason is that GlassFish is not populating the java:comp namespace with the ejbs. GlassFish does populate the java:module namespace so this does work:

      toner = (Toner) InitialContext.doLookup("java:module/Toner");
      printer = (Printer) InitialContext.doLookup("java:module/Printer");

      We (at Oracle) have been having a lengthy discussion about this and have found discrepancies between the EJB spec and the platform spec. In a very simplistic summary when the ejb is in a war the EJB spec (4.4.2.1) does not identify the java:comp as a namespace that must be populated (for the ejb) while the platform spec (5.2.2) says that java:comp refers to the same namespace as java:module implying that the ejb must be able to be looked up via both the java:module and java:comp namespace.

      The following spec issue has been filed to evaluate of Java EE spec 5.2.2 paragraph "For historical reason ..." in relation to EJB spec portable JNDI lookup to clarify the requirement in the ejb spec:

      https://github.com/javaee/ejb-spec/issues/135

              manovotn Matěj Novotný
              jjsnyder Joseph Snyder (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: