Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9261597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:10:36+00:00 2026-06-18T13:10:36+00:00

I need to convert my object generated from WSDL file with CXF cxf-codegen-plugin to

  • 0

I need to convert my object generated from WSDL file with CXF cxf-codegen-plugin to JSON string. I am not lucky to find any solution to that.

As far as I’ve got is: I’ve created a Spring config of CXF JSONProvider:

<bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
    <property name="dropRootElement" value="true"/>
    <property name="dropCollectionWrapperElement" value="false"/>
    <property name="serializeAsArray" value="true"/>
    <property name="ignoreNamespaces" value="true"/>
</bean>

injected it into my bean and now I am trying to use:

try {
    StringWriter writer = new StringWriter();

    jsonProvider.writeTo(
            evaluationType,
            EvaluationType.class,
            new Annotation[]{},
            MediaType.APPLICATION_JSON_TYPE,
            null,
            new StringOutputStream(writer));

    return writer.toString();
} catch (IOException e) {
    LOGGER.error("e", e);
    return "";
}

The question is, what kind of annotations I have to provide to this method? There is no documentation about it. I am getting:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
com.company.test.evaluation.evaluation.EvaluationImpl$1 is a non-static inner class, and JAXB can't handle those.
    this problem is related to the following location:
        at com.company.test.evaluation.EvaluationImpl$1

This EvaluationImpl is the class in which I am calling this method. Please advice what kind of annotations I’ve to provide to this method. Or maybe there is other ways of doing this using CXF JSONProvider?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T13:10:37+00:00Added an answer on June 18, 2026 at 1:10 pm

    I would suggest you to use Jackson ObjectMapper to convert your java objects to JSON there a lot of options for configuring Jackson ObjectMapper and it is more easier to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert a HashMap<String, Object> to an array; could anyone show me
I need to convert a string vector in a simple string. I do not
I need to convert an picture to an object file(.o) use sde-objcopy, then I
I'm trying to convert a JSON object with google maps markers (which are generated
My question is quite simple.. I need to convert an Element object into an
I need to convert a zope 2 DateTime object into a Python datetime object.
I need to convert all of the following forms into .NET Uri object: hello.world
I have an external distance object ( gdis ) and need to convert it
I have a NSData object, i need to convert it a NSDictionary object. NSData
I need to convert a String to enum. I followed the idea in String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.