码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2014-07-23 00:25:08      阅读:2051      评论:0      收藏:0      [点我收藏+]

标签:rest   cxf   webservice   

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

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

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

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

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

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

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

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

at ClientWS.main(ClientWS.java:17)

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

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

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

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

标签:rest   cxf   webservice   

原文地址:http://hongtaoer.blog.51cto.com/8603047/1441477

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!