Spring集成:获取XSD验证错误:cos all limited.1.2

Spring集成:获取XSD验证错误:cos all limited.1.2,spring,integration,xsd-validation,Spring,Integration,Xsd Validation,我在运行Spring集成代码时遇到以下XSD Valdation错误: demo context.xml]无效;嵌套异常为org.xml.sax.SAXParseException:cos all limited.1.2:“all”模型组必须出现在“{min ocurses'}'='{max ocurses'}'=1”的粒子中,并且该粒子必须是构成复杂类型定义的“{content type'}”的一对粒子的一部分 demo-context.xml: <?xml version="1.0"

我在运行Spring集成代码时遇到以下XSD Valdation错误:

demo context.xml]无效;嵌套异常为org.xml.sax.SAXParseException:cos all limited.1.2:“all”模型组必须出现在“{min ocurses'}'='{max ocurses'}'=1”的粒子中,并且该粒子必须是构成复杂类型定义的“{content type'}”的一对粒子的一部分

demo-context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
        http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">

    <import resource="jdbc-context.xml" />

    <int:channel id="request" />
    <int:channel id="response" />

    <int:gateway id="demoService" service-interface="com.integration.DemoService" />

    <int-jdbc:outbound-gateway
        update="INSERT INTO Demo
                SELECT EID, BR from tab1, tab2
                WHERE tab1.BR=tab2.BR AND tab1.BR=:payload "

        request-channel="requestChannel" reply-channel="responseChannel"
        data-source="dataSource" />

    <int:logging-channel-adapter id="loggingChannel"
        channel="responseChannel" expression="'Inserted successfully'" />

</beans>

看起来您的模式验证器不喜欢该模式——但在我看来,该模式还可以(更重要的是,它看起来还可以,在某些细节上比我更可靠)


另一方面,Xerces和Saxon都同意您未命名的XSD验证器,您显示的文档无效;他们抱怨int:logging channel adapter元素上的expression属性,并说不允许使用该名称的属性。

看起来您的模式验证器不喜欢该模式——但该模式在我看来还行(更重要的是,它看起来还行,在某些细节上比我更可靠)


另一方面,Xerces和Saxon都同意您未命名的XSD验证器,您显示的文档无效;他们抱怨int:logging channel adapter元素上的expression属性,并说不允许使用该名称的属性。

从类路径中删除xercesImpl.jar后,错误得到修复。但是,我还是不是很清楚。xercesImpl.jar的包含如何导致异常?如果我需要类路径中的xercesImpl.jar,那么如何修复它呢?从类路径中删除xercesImpl.jar后,错误就得到了修复。但是,我还是不是很清楚。xercesImpl.jar的包含如何导致异常?如果我需要类路径中的xercesImpl.jar,那么如何修复它呢?