我想将JAX-WS集成到我的Spring项目中。找到此链接: http://jax-ws-commons.java.net/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
:配置问题:无法找到XML架构名称空间[http://jax-ws.dev.java.net/spring/servlet
]的Spring NamespaceHandler 违规资源:ServletContext资源[/WEB-INF/applicationContext.xml
]
Eclipse不会报告有关命名空间的任何错误。我发现谷歌有一些类似的问题,但没有修复我的错误。
感谢您的帮助!
答案 0 :(得分:6)
同样的问题:link,你需要jaxws-spring.jar来自 - http://download.java.net/maven/2/org/jvnet/jax-ws-commons/spring/jaxws-spring/