问题描述
因项目要用到webservice技术,所以学习了一下,xfire已经成了cxf了,看来只能用cxf框架来实现了(axis不考虑),好像weblogic平台有自己的webservice框架。我参考了一下这位大师的例子:http://blog.csdn.net/pengchua/archive/2008/07/30/2740572.aspx我把<importresource="classpath:META-INF/cxf/cxf.xml"/><importresource="classpath:META-INF/cxf/cxf-extension-soap.xml"/><importresource="classpath:META-INF/cxf/cxf-servlet.xml"/>这几个文件都放好了。用的cxf是2.0版本的。目前整合时出错如下:2009-05-2216:30:45,569ERROR[StandardContext.java-3733]:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configurationproblem:UnabletolocateSpringNamespaceHandlerforXMLschemanamespace[http://cxf.apache.org/jaxws]Offendingresource:classpathresource[config/spring-cxf.xml]http://cxf.apache.org/jaxws,这个地址确实访问不了。我的web.xml一部分为:<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:config/applicationContext.xml,classpath:config/spring-cxf.xml</param-value></context-param><!--startstruts2--><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><servlet><servlet-name>CXFServlet</servlet-name><servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class></servlet><servlet-mapping><servlet-name>CXFServlet</servlet-name><url-pattern>/services/*</url-pattern></servlet-mapping>spring-cxf.xml为:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:jaxws="http://cxf.apache.org/jaxws"xmlns:soap="http://cxf.apache.org/bindings/soap"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttp://cxf.apache.org/bindings/soaphttp://cxf.apache.org/schemas/configuration/soap.xsdhttp://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd"><importresource="classpath:META-INF/cxf/cxf.xml"/><importresource="classpath:META-INF/cxf/cxf-extension-soap.xml"/><importresource="classpath:META-INF/cxf/cxf-servlet.xml"/><beanid="hello"class="demo.hw.server.HelloWorldImpl"/><jaxws:endpointid="helloWorld"implementor="#hello"address="/HelloWorld"/></beans>跟那位大师是一样的。完全抄他的例子。但就是报那个错误。哪位兄弟知道啊,????
解决方案
解决方案二:
有哪位开发过啊,兄弟们,帮忙讨论一下啊