REST CXF Webservice Client Invoke service-side exception

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.