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 3948786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:24:58+00:00 2026-05-20T01:24:58+00:00

I have a package which just includes and xsd file to generate (via JAXB)

  • 0

I have a package which just includes and xsd file to generate (via JAXB) shared classes which are relevant for our server and client applications. So these classes contain XML annotations.

One client is an Android App. I also want to use these classes here for JSON deserialization because I communicate with a REST service which delivers JSON (with Jersey/Jackson).

I try to use Jackson (version 1.7.2) on the Android like this:

ObjectMapper mapper = new ObjectMapper();
mapper = mapper.configure(DeserializationConfig.Feature.USE_ANNOTATIONS,
                false);
mapper = mapper.configure(SerializationConfig.Feature.USE_ANNOTATIONS,
                false);
FooBar someObject = (FooBar) mapper.readValue(jsonString, FooBar.class);

I though configure the MAPPER should avoid using annotations but I still get

02-07 09:30:18.631: ERROR/AndroidRuntime(447): java.lang.NoClassDefFoundError: javax.xml.bind.annotation.XmlAccessorType
02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at java.lang.Class.getDeclaredAnnotations(Native Method)
02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at org.codehaus.jackson.map.introspect.AnnotatedClass.resolveClassAnnotations(AnnotatedClass.java:292)
02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at org.codehaus.jackson.map.introspect.AnnotatedClass.construct(AnnotatedClass.java:139)

Who knows the trick to stop Jackson from resolving annotations.

Thanks
Klaus

  • 1 1 Answer
  • 2 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-05-20T01:24:58+00:00Added an answer on May 20, 2026 at 1:24 am

    My current investigations lead to these results:

    The usage of the DeserializationConfig.Feature.USE_ANNOTATIONS property (set to false) will cause the JACKSON DeserializerConfig class to use a NopAnnotationIntrospector. Annotations of a class will then be resolved using this NopAnnotationIntrospector. The NopAnnotationIntrospector will return false on each isHandled request for any annotation on a class – and in fact will not use this annotation in further processing.

    So – the system still “inspects” the annotations – which have to be on the Classpath in this case. As Android does not provide any jaxb-api annotations this leads to the NoClassDefFoundError.

    I expected USE_ANNOTATIONS = false would bring JACKSON to totally ignore any annotations – but unfortunately it does not. I will now use the Jackson Streaming API to parse the JSON string instead of using JACKSON Data Binding capabilities.

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

Sidebar

Related Questions

I have simple SSIS package which reads data from flat file and insert into
I have a debian/control file which includes: Build-Depends: ... libboost1.35-dev, libboost-date-time1.35-dev, ... This stops
I have the following ant build file which is supposed to package all class
I do a ssis package which I read an Excel file. I have a
i have an ssis Package which runs on business days (mon-Fri). if i receive
I have simple SSIS package in which On Error event handler I have created
I have a relatively big SSIS package which I'm trying to edit. I basically
I have written an Apex class in a Salesforce managed package which uses the
I have a .NET 3.5 Setup Package Project which installs my application successfully. The
I have standard source code package under Linux which requires to run ./configure make

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.