Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-26793

cvc-complex-type.2.4.a error in <weld:scan> tag in the pom.xml when using CDI 2.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.30.x
    • 4.12.0.Final
    • cdi
    • None
    • Hide

      1) Create new CDI 2.0 Web Project (remember to set the CDI to value 2.0 and java to version 1.8)
      2) Change the content of the beans.xml file to:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans bean-discovery-mode="all" version="2.0"
       xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:weld="http://jboss.org/schema/weld/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd">
       <weld:scan>
        <weld:exclude name="exclude.p1.Bean1"/>
       </weld:scan>
      </beans>
      

      3) Create new package with name exclude.p1
      4) Create new Bean with name Bean1
      5) See the error in the beans.xml file similar to the one captured on the beans-xml.png image in the attachment

      Show
      1) Create new CDI 2.0 Web Project (remember to set the CDI to value 2.0 and java to version 1.8) 2) Change the content of the beans.xml file to: <?xml version= "1.0" encoding= "UTF-8" ?> <beans bean-discovery-mode= "all" version= "2.0" xmlns= "http://xmlns.jcp.org/xml/ns/javaee" xmlns:weld = "http://jboss.org/schema/weld/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd" > <weld:scan> <weld:exclude name= "exclude.p1.Bean1" /> </weld:scan> </beans> 3) Create new package with name exclude.p1 4) Create new Bean with name Bean1 5) See the error in the beans.xml file similar to the one captured on the beans-xml.png image in the attachment
    • Medium

      Error message:

      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.
      

      Affected weld version details:

      • Weld se version: 2.2.4.Final, 2.4.8.Final
      • Weld api version: 2.2.SP3, 3.1.SP1

      Additional information:

      • error only appears when using CDI 2.0, older versions of CDI are working properly
      • Error appears when using WildFly 16 and in several CodeReady Studio version (July/August)
      • See the pom-xml.png image in the attachment to see, where the error appears

        1. pom-xml.png
          341 kB
          Zbyněk Červinka

            Unassigned Unassigned
            zcervink Zbyněk Červinka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: