Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-714

URLScanner parses the same beans.xml file if beans.xml is in WEB-INF/classes/META-INF in a WAR package

    XMLWordPrintable

Details

    • Hide

      1) Place a beans.xml file with interceptors configured in WEB-INF\classes\META-INF (tested in a exploded WAR)
      2) Place a breakpoint on org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive in line 65.

      • just after this line: scanner.scanResources(new String[] { META_INF_BEANS_XML }

        , classes, urls);
        3) You will see that each element in the List called urls List has the same value. The size of the List is proportional to the found beans.xml in your application (including those inside WEB-INF/lib)

      Show
      1) Place a beans.xml file with interceptors configured in WEB-INF\classes\META-INF (tested in a exploded WAR) 2) Place a breakpoint on org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive in line 65. just after this line: scanner.scanResources(new String[] { META_INF_BEANS_XML } , classes, urls); 3) You will see that each element in the List called urls List has the same value. The size of the List is proportional to the found beans.xml in your application (including those inside WEB-INF/lib)
    • Workaround Exists
    • Hide

      Place beans.xml under WEB-INF

      Show
      Place beans.xml under WEB-INF

    Description

      URLScanner parses the same beans.xml file if beans.xml is in WEB-INF/classes/META-INF in a WAR package.

      This is due to misuse of the ClassLoader (it´s invoking getResource in method handleArchiveByFile, so it´s not getting the absolute URL)

      Attachments

        Issue Links

          Activity

            People

              pmuiratbleepbleep Pete Muir (Inactive)
              rhn-support-ggastald George Gastaldi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: