Spring“应用程序上下文" XSD架构读取问题 [英] Spring 'application-context' XSD schema read issue

查看:63
本文介绍了Spring“应用程序上下文" XSD架构读取问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在spring项目中使用JAXWS与服务器通信,并且在我的应用程序上下文xml中读取XSD时出错.这是应用程序上下文-

I'm using JAXWS in my spring project to communicate with server and there is an error of XSD reading in my application context xml. Here is the application context -

 <?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:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:ws="http://jax-ws.java.net/spring/core"
    xmlns:wss="http://jax-ws.java.net/spring/servlet"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

  //**error at this below line -**  **cvc-complex-type.2.4.c: The matching wildcard is   strict, but no declaration can be found for element 'wss:binding'.**
  <wss:binding url="/hello">
    <wss:service>
        <ws:service bean="#helloWs"/>
    </wss:service>
   </wss:binding>

  <!-- Web service methods -->
  <bean id="helloWs" class="com.mkyong.ws.HelloWorldWS">
    <property name="helloWorldBo" ref="HelloWorldBo" />
  </bean>

  <bean id="HelloWorldBo" class="com.mkyong.bo.impl.HelloWorldBoImpl" />

任何人都可以让我知道此错误的原因以及任何解决方案. 感谢您的帮助.

Can any one please let me know what could be the reason for this error and any solution. Thanks for any help.!

推荐答案

您在项目中使用spring吗?,我遇到了同样的问题,但是当我在我的maven依赖项中包含spring-jaxws时,问题就解决了,实际上,您可以在该jar中看到META-INF/spring.schemas文件正在重新定义XSD的位置:

are you using spring in your project?, I had the same problem, but when I included spring-jaxws in my maven dependencies the problem solved, in fact, yo can see in that jar that the META-INF/spring.schemas file is redefining the XSDs locations:

http \://jax-ws.java.net/spring/core.xsd=spring-jax-ws-core.xsd http \://jax-ws.java.net/spring/servlet.xsd=spring-jax-ws-servlet.xsd http \://jax-ws.java.net/spring/local-transport.xsd=spring-jax-ws-local-transport.xsd

http\://jax-ws.java.net/spring/core.xsd=spring-jax-ws-core.xsd http\://jax-ws.java.net/spring/servlet.xsd=spring-jax-ws-servlet.xsd http\://jax-ws.java.net/spring/local-transport.xsd=spring-jax-ws-local-transport.xsd

希望它能对您有所帮助!

I wish it helps!

这篇关于Spring“应用程序上下文" XSD架构读取问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆