2011-03-20 63 views
7

我想将JAX-WS集成到我的Spring项目中。发现此链接: http://jax-ws-commons.java.net/spring/无法找到JAX-WS的Spring命名空间

我收养了它,它集成到我的的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: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.0.xsd 
      http://www.springframework.org/schema/context 
      http://www.springframework.org/schema/context/spring-context-3.0.xsd 
      http://www.springframework.org/schema/task 
      http://www.springframework.org/schema/task/spring-task-3.0.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 
      http://jax-ws.dev.java.net/spring/servlet.xsd"> 

    <context:annotation-config /> 
    <context:component-scan base-package="cloud" /> 
    <task:annotation-driven/> 

    <wss:binding url="/notification" service="#notificationService"></wss:binding> 
    <ws:service id="notificationService" bean="#notificationImpl"></ws:service> 

    <bean id="notificationImpl" class="cloud.balancer.Notification" /> 
</beans> 

但每次我启动Tomcat的时候,我得到这个异常:

SEVERE:将异常发送上下文初始化事件给类的监听器实例org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:Un能够找到春天NamespaceHandler XML模式命名空间[http://jax-ws.dev.java.net/spring/servlet] 犯规资源:ServletContext的资源[/WEB-INF/applicationContext.xml]

Eclipse不报告关于命名空间的任何错误。我发现了一些与谷歌类似的问题,但没有解决我的错误。

感谢您的帮助!在此

+0

只是一种预感 - 尝试添加[这](http://download.java.net/maven/2/org/ jvnet/jax-ws-commons/spring/jaxws-spring/1.8/jaxws-spring-1.8.jar)依赖于你的类路径。 – 2011-03-20 20:14:16

+0

雅,你错过了这段代码所在的JAR。 – sourcedelica 2011-03-20 21:35:06

+0

是的,你是对的。这个lib丢失了。非常感谢你! – Tommy 2011-03-21 08:15:28

回答