-
Bug
-
Resolution: Done
-
Minor
-
2.2.9.Final
-
None
When discovery kicks in and the WebAppBeanArchiveScanner does its thing, there is a warning that is printed out that is bogus.
WELD-ENV-001004: Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It's not portable to use both locations at the same time. Weld is going to use file:/home/joakim/code/path/to/WEB-INF/beans.xml.
Because of the following code ...
// WEB-INF/classes URL beansXmlUrl = null; for (String resource : RESOURCES) { URL resourceUrl; resourceUrl = servletContext.getResource(resource); if (beansXmlUrl != null) { WeldServletLogger.LOG.foundBothConfiguration(beansXmlUrl); } else { beansXmlUrl = resourceUrl; } }
If the "/WEB-INF/beans.xml" exists, and the "/WEB-INF/classes/META-INF/beans.xml" does not, then this warning is printed out.
The conditional should be
if ( (resourceUrl != null) && (beansXmlUrl != null) ) { WeldServletLogger.LOG.foundBothConfiguration(beansXmlUrl); } else {