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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:33:11+00:00 2026-06-17T08:33:11+00:00

Jackson has annotations for ignoring unknown properties within a class using: @JsonIgnoreProperties(ignoreUnknown = true)

  • 0

Jackson has annotations for ignoring unknown properties within a class using:

@JsonIgnoreProperties(ignoreUnknown = true) 

It allows you to ignore a specific property using this annotation:

@JsonIgnore

If you’d like to globally set it you can modify the object mapper:

// jackson 1.9 and before
objectMapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// or jackson 2.0
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

How do you set this globally using spring so it can be @Autowired at server start up without writing additional classes?

  • 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-17T08:33:12+00:00Added an answer on June 17, 2026 at 8:33 am

    This can be achieved using spring’s MethodInvokingFactoryBean:

    <!-- Jackson Mapper -->
    <bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper" />
    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject" ref="jacksonObjectMapper" />
        <property name="targetMethod" value="configure" />
        <property name="arguments">
            <list>
                <value type="org.codehaus.jackson.map.DeserializationConfig.Feature">FAIL_ON_UNKNOWN_PROPERTIES</value>
                <value>false</value>
            </list>
        </property>
    </bean>
    

    This can be wired to a RestTemplate like this:

    <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
        <property name="messageConverters">
            <list>
                <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
                    <property name="objectMapper" ref="jacksonObjectMapper" />
                </bean>
            </list>
        </property>
    </bean>
    

    It can also be injected directly into the message converters for use with Spring MVC:

    <mvc:annotation-driven>
        <mvc:message-converters>
            <!-- Jackson converter for HTTP messages -->
            <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
                <property name="objectMapper" ref="jacksonObjectMapper" />
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Jackson library. I want to ignore a specific field when serializing/deserializing,
Typefactory class at jackson has many deprecated methods inside it. I am using it
I'm using jackson 2.0 to serialize a class that has a reference to itself.
I am using JACKSON 1.6.3 version. I have one class which has a reference
I have a class that has more than a dozen properties. For most of
I'm using ObjectMapper in the following situation, however, the Person class has a JSON
I'm using jackson to convert an object of mine to json. The object has
I'm using Jackson to serialize and deserialize objects. The problem is that sometimes I
How would you deserialize a JSON document to a POJO using Jackson if you
I'm trying to read a legacy JSON code using Jackson 2.0-RC3, however I'm stuck

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.