REST CXF Webservice 客户端调用服务端异常

Exception in thread "main" javax.ws.rs.client.ClientException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.staxutils.StaxUtilsjava

at org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:1125)apache

at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1088)api

at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1038)ide

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:858)spa

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:832)orm

at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:395)xml

at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:574)get

at ClientWS.main(ClientWS.java:17)it

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.staxutils.StaxUtilsio

at org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:207)

at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1288)

at org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:506)

at org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:1104)

... 7 more



缘由:

缺乏jar包 stax2-api-3.1.1.jar,也许缺乏其它jar也会有此问题


个人客户端调用服务端代码引入的jar包列表:


cxf-2.7.6.jar

geronimo-jaxws-2.2_spec-1.1.jar

javax.ws.rs-api-2.0-m10.jar

jaxb-api-2.2.6.jar

neethi-3.0.2.jar

stax2-api-3.1.1.jar

woodstox-core-asl-4.2.0.jar

wsdl4j-1.6.3.jar

xercesImpl-2.9.1.jar

xmlschema-core-2.0.jar

可能有些没有用到,可是至少有这些没有报错。

相关文章
相关标签/搜索