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
|
Reason:
Missing jar package Stax2-api-3.1.1.jar, may be missing other jars also have this problem
My client invokes a list of jar packages introduced by the server-side code:
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
Some may not be used, but at least there are no errors.
REST CXF Webservice Client Invoke service-side exception