org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'drools:grid-node'.
當我添加一個網格節點和ksession我的Spring XML我得到這個錯誤。我做了一些搜索,看起來像是一個類路徑問題。我在這裏缺少什麼依賴性?org.xml.sax.SAXParseException:CVC-複雜type.2.4.c:匹配通配符是嚴格
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://drools.org/schema/drools-spring org/drools/container/spring
http://drools.org/schema/drools-spring org/drools/container/spring/drools-spring-1.2.0.xsd">
<drools:grid-node id="node1"/>
<drools:ksession id="ksession1" type="stateful" kbase="kbase1" node="node1" />
我的pom.xml對於Drools具有以下內容。
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-camel</artifactId>
<version>${drools.version}</version>
<exclusions>
<!-- This ensures that we use the latest version of Spring jars and not
the one that comes with drools.version. -->
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
</exclusion>
<exclusion>
<artifactId>camel-xstream</artifactId>
<groupId>org.apache.camel</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-spring</artifactId>
<version>${drools.version}</version>
</dependency>
感謝您提供這些鏈接和詳細信息。然而,我有這個大部分,它仍然給我同樣的錯誤:( – 2012-03-20 16:37:13
)你有沒有嘗試將'xConf.xml'(讓我們命名爲'drools-spring.xsd')放在'applicationContext.xml'旁邊,並直接在' xsi:schemaLocation',像這樣:'http://drools.org/schema/drools-spring org/drools/container/spring drools-spring.xsd'? 另外,你是否生成了一個JAR文件你的依賴和模塊?如果是這樣,'META-INF/spring.handlers'文件可能會被覆蓋,如果是這樣的話,請參閱[從Java開始的Spring應用程序啓動問題](http://stackoverflow.com/ q/3650252/851811) – 2012-03-20 16:53:14
我正在使用Maven創建一個WAR文件,在我的Spring XML中有以下內容:http://drools.org/schema/drools-spring http://drools.org/schema /drools-spring-1.5.0.xsd。加入\t \t \t \t \t org.drools \t \t \t 滴料彈簧 \t \t \t $ {} drools.version 得到滴料,彈簧5.3.0.Final.jar它具有META-INF /spring.handlers。我刪除了我的maven緩存(.m2/repository),看起來它現在工作正常(至少在運行時我沒有得到異常。)但是,我仍然在Eclipse上得到一個錯誤標記。 –
2012-03-20 17:13:08