Methods for handling and obtaining error-describing text for not returning 200 errors in Apache CXF

Source: Internet
Author: User


We encountered some problems using the Apache CXF framework, and generally, if we use the rest client if the return of the processing is correct, then we can easily handle it, but if we return a request return code that is not 200, In this case we found that the exception object does not contain any text in the error message when debugging:

such as this screenshot of the request (we use restclient) test, the return code is 400, the return of the response in the error description field, we want to get the content of this field, but we tried many times, not directly from the exception object to get , which means that none of the similar fields or API methods can be directly obtained.

Our attempt (Debug) screenshot is as follows:

It can be very obvious from here that there is no one field that can directly get the content corresponding to our description text, so our attempt failed.

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: 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.