我想将JAX-WS集成到我的
Spring项目中.找到此链接:
http://jax-ws-commons.java.net/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: Exception sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException
: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://jax-ws.dev.java.net/spring/servlet
]
Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml
]
Eclipse不会报告有关命名空间的任何错误.我发现谷歌有一些类似的问题,但没有修复我的错误.
谢谢你的帮助!
解决方法
同样的问题:
link,你需要来自-
http://download.java.net/maven/2/org/jvnet/jax-ws-commons/spring/jaxws-spring/的jaxws-spring.jar