Details

    • Story
    • Resolution: Duplicate
    • Major
    • 2.5.0.Final
    • None
    • EAP6 -> EAP7
    • None
    • Sprint 37

    Description

      From JBoss EAP 7.1 Migration Guide:

      5.5. CDI 1.2 Application Changes

      JBoss EAP 7 includes support for CDI 1.2. As a result, applications written using CDI 1.0 might see some changes in behavior when migrated to JBoss EAP 7. This section summarizes only a few of those changes.

      You can find more information about Weld and CDI 1.2 in the following references:

      Contexts and Dependency Injection for the Java EE platform
      CDI 1.2 Javadoc
      Weld 2.3.3.Final - CDI Reference Implementation
      Bean Archives

      Bean classes of enabled beans must be deployed in bean archives to ensure they are scanned by CDI to find and process the bean classes.

      In CDI 1.0, an archive was defined as an explicit bean archive if it contained a beans.xml file in the META-INF/ directory for an application client, EJB, or library JAR, or if it contained a beans.xml file in the WEB-INF/ directory for a WAR.

      CDI 1.1 introduced implicit bean archives, which are archives that contain one or more bean classes with a bean defining annotation, or one or more session beans. Implicit bean archives are scanned by CDI and, during type discovery, only classes with bean defining annotations are discovered. For more information, see Type and Bean Discovery in Contexts and Dependency Injection for the Java EE platform.

      A bean archive has a bean discovery mode of all, annotated or none. A bean archive that contains a beans.xml file with no version has a default bean discovery mode of all. A bean archive that contains a beans.xml file with version 1.1 or later must specify the bean-discovery-mode attribute. The default value for the attribute is annotated.

      An archive is not a bean archive in the following cases:

      It contains a beans.xml file with a bean-discovery-mode of none.
      It contains a CDI extension with no beans.xml file.
      An archive is an explicit bean archive in the following cases:

      The archive contains a beans.xml file with a version number of 1.1 or later and a bean-discovery-mode of all.
      The archive contains a beans.xml file with no version number.
      The archive contains an empty beans.xml file.
      An archive is an implicit bean archive in the following cases:

      The archive contains one or more bean classes with a bean defining annotation, or one or more session beans, even if it does not contain a beans.xml file.
      The archive contains a beans.xml file with a bean-discovery-mode of annotated.
      CDI 1.2 limited bean defining annotations to the following:

      @ApplicationScoped, @SessionScoped, @ConversationScoped, and @RequestScoped annotations
      All other normal scope types
      @Interceptor and @Decorator annotations
      All stereotype annotations, which are annotations annotated with @Stereotype
      @Dependent scope annotation
      For more information about bean archives, see Bean Archives in Contexts and Dependency Injection for the Java EE platform.

      Clarification of Conversation Resolution

      The conversation context lifecycle was changed to prevent conflicts with the Servlet specification as described in CDI Specification Issue CDI-411. The conversation scope is active during all servlet requests and should not prevent other servlets or servlet filters from setting the request body or character encoding.

      Observer Resolution

      Event resolution has been partly rewritten in CDI 1.2. In CDI 1.0, an event is delivered to an observer method if the observer method has all the event qualifiers. In CDI 1.2, an event is delivered to an observer method if the observer method has no event qualifiers or has a subset of the event qualifiers.

      A new set of RHAMT Rules should be added to address the app migration issues detailed above. Please let me know if you need further info for the "when"s and "perform"s.

      Attachments

        Issue Links

          Activity

            People

              mnovotny@redhat.com Marek Novotny
              emartins@redhat.com Eduardo Martins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: