首页 > 编程语言> > java – Spring metro integration cvc-complex-type.2.4.c:匹配的通配符是strict,但是找不到元素’wss:binding’的声明
java – Spring metro integration cvc-complex-type.2.4.c:匹配的通配符是strict,但是找不到元素’wss:binding’的声明
作者:互联网
我尝试将地铁网络服务与春天融为一体.但是我在applicationContext.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:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
https://jax-ws.dev.java.net/spring/servlet.xsd">
//Some beans
//!!!!!!!!ERROR
<wss:binding url="/ws">
<wss:service>
<ws:service bean="#newsWebService" />
</wss:service>
</wss:binding>
<bean id="newsWebService" class="com.news.webservice.NewsWebService">
<property name="newsBo" ref="newsBo"/>
</bean>
</beans>
错误信息:
Multiple annotations found at this line:
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'.
- schema_reference.4: Failed to read schema document 'https://jax-ws.dev.java.net/spring/servlet.xsd', because 1) could
not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
我添加了lib x-bean-spring-3.7.jar和jaxws-spring-1.8.jar
我也检查了jaxws-spring-1.8.jar中的spring.schemas并获取
# See XBEAN-60. To work around the overwriting issue, this file is maintained manually.
# this file is used by Spring to resolve resources locally.
# the key is the system ID and the value is the actual file location in this jar.
http\://jax-ws.dev.java.net/spring/core.xsd=spring-jax-ws-core.xsd
http\://jax-ws.dev.java.net/spring/servlet.xsd=spring-jax-ws-servlet.xsd
http\://jax-ws.dev.java.net/spring/local-transport.xsd=spring-jax-ws-local-transport.xsd
根据这个,我包括了shemas.
#更新
我发现了一些奇怪的事我在spring-beans-3.2.0.M1.jar spring.shemas中打开
http\://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd
http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd
我只是通过http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd下一对获得applicationContext.xml而没有错误
拜托,帮我找理由.
解决方法:
编辑:以前的答案被eclipse接受,但在运行时触发了异常.这是我最后的工作配置
使用此方法,xsd架构已被移动:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://jax-ws.dev.java.net/spring/core http://jax-ws.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"
default-lazy-init="true">
标签:spring-integration,java,spring,web-services,java-metro-framework 来源: https://codeday.me/bug/20190901/1784268.html