我正在尝试做一个POC来将Spring-MVC与Drools集成。
我的mvc调度程序servlet。xml文件尝试读取kie-spring。xsd文件。
这个
file location
drools网站上给出404。因此,该模式不可访问,并发出如下警告。
“警告:忽略XML验证警告
组织。xml。萨克斯。SAXParseException;行号:25;列数:35;schema_引用。4: 无法读取架构文档'
http://drools.org/schema/kie-spring.xsd
,因为1)找不到文档;2) 文件无法读取;3) 文档的根元素不是。"
上述警告似乎导致第25行出现错误。I它将错误显示为“匹配的通配符是严格的,但找不到元素‘kie:kmodule’的声明。”
当出现以下错误时:
“严重:上下文初始化失败
组织。springframework。豆。工厂xml。XmlBeanDefinitionStoreException:ServletContext资源[WEB-INF/mvc dispatcher servlet.XML]的XML文档中的第25行无效;嵌套异常为org。xml。萨克斯。SAXParseException;行号:25;列数:35;cvc复合型。2.4.c: 匹配的通配符是严格的,但找不到元素“kie:kmodule”的声明。"
我在另一个Stackoverflow问题中发现了同样的问题
here
.
下面是mvc dispatcher servlet。xml::
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:kie="http://drools.org/schema/kie-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd">
<context:component-scan base-package="com.kiespring.mvc.controller" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="kieUtil" class="org.kie.spring.KieSpringUtil"/>
<kie:kmodule id="sample_module">
<kie:kbase name="kbase1" packages="org.drools.spring.sample"/>
</kie:kmodule>
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
</beans>
POM文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kie.sample</groupId>
<artifactId>kie-springmvc</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>kie-springmvc Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<kie.spring.version>6.0.1.FINAL</kie.spring.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-spring</artifactId>
<version>${kie.spring.version}</version>
</dependency>
</dependencies>
<build>
<finalName>kie-springmvc</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
我对设置进行了更改。xml for http在我的maven安装全局和用户设置中。