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

  • Home
  • SEARCH
  • 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 8765719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:21:33+00:00 2026-06-13T16:21:33+00:00

I am using JSON Jackson 2.0 to write a data Model to file and

  • 0

I am using JSON Jackson 2.0 to write a data Model to file and then load it back into the application. I can successfully write the object into a string but I encounter the following error message when trying to marshal it back into a object:

No suitable constructor found for type [simple type, class ImportAttributeModel]: can not instantiate from JSON object (need to add/enable type information?)
at [Source: user; line: 1, column: 111] (through reference chain: ImportTemplateModel[“modelList”])

This is a code snippet of my classes:

public class ImportTemplateModel 
{  
  private Map<Integer, AttributeModel> m_modelList;
  private GraphElementType m_type; 

  public ImportTemplateModel() 
  {

  }
// getters  & setters
}

public class AttributeModel 
{
   private String m_label;
   private String m_key;
   private ElementDefinition m_definition;

   public AttributeModel(String label, String key, ElementDefinition def)
   {
      m_label = label;
      m_key = key;
      m_definition = def;
   }
// getters  & setters
}

Here is the calls I make to write & read the model:

// Write model
ObjectMapper mapper = new ObjectMapper();
ImportTemplateModel itm = new ImportTemplateModel()
// set model atttributes
...
//

try {
  mapper.writeValue(new File(filepath), itm);

} 
catch (IOException e) {

}
.... 

// Read Model
ObjectMapper mapper = new ObjectMapper();
try {
  mapper.readValue(new File(filepath), ImportTemplateModel.class);

}
catch (IOException e) {

}

I am not sure what I am doing wrong at the moment… Is it because AttributeModel is not a POJO? or is it I can’t use Maps for this implementation? If so, how do I get around this?

  • 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-13T16:21:35+00:00Added an answer on June 13, 2026 at 4:21 pm

    It needs to have a no-argument constructor so Jackson can instantiate it.

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

Sidebar

Related Questions

Currently I'm using the Jackson JSON Processor to write preference data and whatnot to
I'm having trouble getting Jackson to correctly deserialize json into an object when calling
I am using jackson json api to map json data to java objects. All
I would like to write some JSON every 5th second. I'm using Jackson to
I've implemented a Spring RESTful web service. Using Jackson JSON for Object Mapping. I
I'm using Jackson to deserialize a json array into some objects. Here's my class:
I am serializing and deserializing following domain object to JSON using Jackson 1.8.3 public
How can I receive the node names from a JSON tree using Jackson? The
I am using Jackson in order to send data in JSON type between a
I am using Jackson library's ObjectMapper for deserializing JSON into Java objects. I am

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.