我在运行 Spring Integrtion 代码时遇到 XSD Valdation 错误:
demo-context.xml] 无效;嵌套异常是 org.xml.sax.SAXParseException: cos-all-limited.1.2: 一个 ''all'' 模型组必须出现在具有 '{'min occur'}'='{'max occur'}' 的粒子中=1,并且该粒子必须是构成复杂类型定义的'{'content type'}'的对的一部分。
演示上下文.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>