0 Replies Latest reply on Jul 22, 2014 10:34 AM by Stefan Großmann

    Include filters and Weld-SE

    Stefan Großmann Newbie

      Hi,

       

      I recently updated to Weld-SE 2.2.3.Final and I discovered a problem using include filters. An include filter in a beans.xml has the effect, that all classed which are not “included” are not discovered by the CDI Container.

       

      Example:

       

      <scan>
              <include name="my.package.to.include.**" />
      </scan>
      

       

      In Weld SE without “Archive Isolation” (see the "org.jboss.weld.se.archive.isolation" system-property) all discovered beans.xml files are merged internally into one beans.xml file. If now one of the beans.xml files contains an include filter, the filter will become part of the merged beans.xml.

       

      In my case, one of several JAR Files contained an include section with the intention, to make just a part of this JAR available for discovery. The result was that everything else, also the beans of all other JAR-files where unavailable. This was breaking our application when we update to the current weld version.

       

      Of course it is easy to fix that problem just by changing the beans.xml of that particular jar. But I think this feature makes not much sense in a client/SE environment. Therefore I think it would be good to not support include filters if “archive isolation” is switched off.

       

      What do you think?

       

      Thanks for your comments

       

      Stefan