glassfish
  1. glassfish
  2. GLASSFISH-11329

META-INF/beans.xml in WAR classpath not sufficient to activate CDI

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: V3
    • Fix Version/s: V3
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      11,329

      Description

      If a WAR is deployed containing WEB-INF/classes/META-INF/beans.xml, CDI does not
      get activated (no beans are detected). Activation only happens if the WAR
      contains WEB-INF/beans.xml.

      I'm not sure why GlassFish V3 is having a problem finding beans.xml in the
      META-INF directory of the WAR classpath. I can't tell if it is a problem in Weld
      or a problem in GlassFish V3 somewhere.

      Related Weld issue: https://jira.jboss.org/jira/browse/WELD-347

        Activity

        Hide
        rogerk added a comment -

        Will take a look.

        Show
        rogerk added a comment - Will take a look.
        Hide
        mojavelinux added a comment -

        According to section 12.1 of the JSR-299 specification:

        Bean classes of enabled beans must be deployed in bean archives.

        • A library jar, EJB jar, application client jar or rar archive is a bean
          archive if it has a file named beans.xml in the META-INF directory.
        • The WEB-INF/classes directory of a war is a bean archive if there is a file
          named beans.xml in the WEB-INF directory of the war.
        • A directory in the JVM classpath is a bean archive if it has a file named
          beans.xml in the META-INF directory.

        It really depends on how loosely you interpret these rules. Technically,
        WEB-INF/classes/META-INF is not a valid location. But that seems really
        inconvenient because it is the one classpath that doesn't allow use of the
        META-INF directory for declaring a bean archive.

        Show
        mojavelinux added a comment - According to section 12.1 of the JSR-299 specification: Bean classes of enabled beans must be deployed in bean archives. A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the META-INF directory. The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the WEB-INF directory of the war. A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory. It really depends on how loosely you interpret these rules. Technically , WEB-INF/classes/META-INF is not a valid location. But that seems really inconvenient because it is the one classpath that doesn't allow use of the META-INF directory for declaring a bean archive.
        Hide
        mojavelinux added a comment -

        JBoss AS 6 supports the location cited in this issue. I'm not arguing it is
        correct, just that it works.

        Show
        mojavelinux added a comment - JBoss AS 6 supports the location cited in this issue. I'm not arguing it is correct, just that it works.
        Hide
        rogerk added a comment -

        This is filed as : https://jira.jboss.org/jira/browse/WELD-347

        Marking here as feature request (as is marked in JIRA issue).

        Show
        rogerk added a comment - This is filed as : https://jira.jboss.org/jira/browse/WELD-347 Marking here as feature request (as is marked in JIRA issue).

          People

          • Assignee:
            rogerk
            Reporter:
            mojavelinux
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: