当我尝试在dispatcher-servlet.xml
中添加spring-mvc
模式时,出现以下错误。我从STS中给出的spring示例中复制了xml文件。我正在使用Spring 4.1.1。只有起诉mvc
架构时,而不是其他任何会发生此问题:给出SAXParseException的Spring MVC模式
org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 116; Error: cos-all-limited.1.2: The minOccurs attribute of a model group with "all" compositor that is part of a pair that is the content type of a complex type definition must have the value one. The value "0" is incorrect.
我的文件是:
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<annotation-driven />
<resources mapping="/resources/**" location="/resources/" />
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/jsp/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.mj.cchp" />
</beans:beans>
您提供的错误和架构似乎不相关。你确定? – Keerthivasan 2015-01-21 04:55:10
@Keerthivasan是的。只有当我包含mvc模式时才会出现此错误,否则将发生此错误。 – khateeb 2015-01-21 04:58:52
导入的XSD模式文件可能存在问题。版本冲突。我认为您需要在'schemaLocation'属性中提供适当版本的XSD的URL。请查看 – Keerthivasan 2015-01-21 05:01:28