日期:2014-05-17  浏览次数:20846 次

关于websphere V7.0 解析 cxf 的 wsdl 异常问题。
如题。cxf-2.2.9+spring2.5 的应用。从tomcat 移植到was 7.0 上面。服务端的SOAP接口,可以正常提供服务,客户端访问页没有问题。只是在访问WSDL的时候提示异常。  
   http://localhost:9080/myapp/msgService?wsdl。异常信息如下 

[11-2-15 16:23:16:312 CST] 00000019 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: 应用程序 myapp 中 servlet CXFServlet 的某一服务方法创建了未捕获到的异常。创建的异常:java.lang.NoSuchMethodError: org/apache/ws/commons/schema/XmlSchema.getSchemaDocument()Lorg/w3c/dom/Document;
at org.apache.cxf.service.model.SchemaInfo.getElement(SchemaInfo.java:109)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.buildTypes(ServiceWSDLBuilder.java:277)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.build(ServiceWSDLBuilder.java:189)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.build(ServiceWSDLBuilder.java:149)
at org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:153)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:162)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)



从异常信息来看 貌似是wsdl4j 在解析wsdl的时候出的问题。所以怀疑是 我应用带 wsdl4j-1.6.2.jar 与 WAS自带的wsdl4j.jar 发生了冲突。我尝试改变 应用模块的类加载策略。改为(类已装入并且是先使用本地类装入器父类最后)。改完之后。正常的应用也不能访问了报了一个404的错误。 
[11-2-15 16:40:55:609 CS