繁体   English   中英

JAXWS的Spring 3.1名称空间问题

[英]Spring 3.1 namespace issue with JAXWS

我尝试用Spring 3.1实现一个Web服务。 但是启动服务器时出现错误,我真的不知道为什么:

2013-08-22 09:58:03,602 [main] ERROR org.apache.catalina.core.ContainerBase[Catalina].  [localhost].[/OcrMonitor] - Servlet /OcrMonitor threw load() exception
org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 33; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element '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:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:task="http://www.springframework.org/schema/task"
    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.1.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
        http://www.springframework.org/schema/mvc   http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.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">

    <context:annotation-config />
    <context:component-scan base-package="com.xyz" />

    <tx:annotation-driven />
    <mvc:annotation-driven />
    <task:annotation-driven />  

  <wss:binding url="/iceBoxWS" >
    <wss:service>
        <ws:service bean="#IceBoxWs" >
            <ws:handlers>
                <ref bean="IceBoxBo" />
            </ws:handlers>
        </ws:service>
    </wss:service>
  </wss:binding>

  <bean id="IceBoxWs" class="com.xyz.web.service.IceBoxWS">
    <property name="iceBoxBo" ref="IceBoxBo" />
  </bean>

  <bean id="IceBoxBo" class="com.xyz.web.service.IceBoxServiceImpl"/> 

以及pom.xml的相关部分:

<!-- Spring -->

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>3.1.1.RELEASE</version>
    <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>                            
    </exclusions>                       
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>3.1.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>3.1.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jms</artifactId>
    <version>3.1.1.RELEASE</version>
</dependency>               

<!-- JAX-WS --> 
<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.2.3</version>
</dependency>

<!-- Library from java.net, integrate Spring with JAX-WS --> 
<dependency>
    <groupId>org.jvnet.jax-ws-commons.spring</groupId>
    <artifactId>jaxws-spring</artifactId>
    <version>1.8</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.sun.xml.stream.buffer</groupId>
            <artifactId>streambuffer</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.jvnet.staxex</groupId>
            <artifactId>stax-ex</artifactId>
        </exclusion>
    </exclusions>
</dependency>

任何想法或帮助都将受到赞赏!

好像您缺少一个罐子; 从您的pom看起来像xbean-spring-2.8.jar 在项目中下载依赖项,然后尝试再次构建

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM