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

Warning at Weld 3 startup with XSD invalid beans.xml for weld:scan tag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.0.1.Final
    • None
    • None

      I just updated Weld from version 2.4.4 to 3.0.1. I am facing the following error at the application startup and I cannot found a solution. I am using Weld SE.

      Sep 15, 2017 1:25:12 PM org.jboss.weld.xml.BeansXmlHandler error
      WARN: WELD-001208: Error when validating file:/(...)/META-INF/beans.xml@7 against xsd. cvc-complex-type.2.4.a: Invalid content was found starting with element 'weld:scan'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":interceptors, "http://xmlns.jcp.org/xml/ns/javaee":decorators, "http://xmlns.jcp.org/xml/ns/javaee":alternatives, "http://xmlns.jcp.org/xml/ns/javaee":scan, "http://xmlns.jcp.org/xml/ns/javaee":trim}' is expected.
      
      

      The beans.xml contains a Weld specific tag to include some classes in the scan (as only exclusion is supported by the CDI specification).

      <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:weld="http://jboss.org/schema/weld/beans"
             xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
              http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
             bean-discovery-mode="all">
          <weld:scan>
              <weld:include name="com.company.mypackage"/>
              (...)
          </weld:scan>
      </beans>
      

      I use the following Maven Weld SE dependency.

      <dependency>
          <groupId>org.jboss.weld.se</groupId>
          <artifactId>weld-se-core</artifactId>
          <version>3.0.1.Final</version>
      </dependency>
      

      Could you tell me what should I do to solve this problem? I have checked for a CDI 2.0 XSD but I haven't found any. Perhaps, the include restriction for the scan is now supported natively by CDI? Or perhaps the Weld XSD has changed?

      I have also posted my report on Stack Overflow.

              manovotn Matěj Novotný
              nicolas.henneaux Nicolas Henneaux (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: