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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:58:41+00:00 2026-06-14T01:58:41+00:00

the json like this { resultCode: 0000, resultMsg: , pageCount: 6, curPage: 1, infoItems:

  • 0

the json like this

   {
      "resultCode": "0000",
      "resultMsg": "",
      "pageCount": "6",
      "curPage": "1",
      "infoItems": [
        {
          "sID": "268",
          "location": "222",
          "unit": "",
          "time": "2012-11-02 17:51:46",
          "longitude": "111",
          "latitude": "222",
          "reason": "some",
          "dealContent": ""
        },
        {
          "sID": "267",
          "location": "fgg",
          "unit": "yyg",
          "time": "2012-11-02 17:49:14",
          "longitude": "111",
          "latitude": "222",
          "reason": "some",
          "dealContent": ""
        }
    ]
}

How could I decode it to java class?

I write a class like

public class UploadedInfoObjEx {
    public String resultCode;
    public String resultMsg;
    public String pageCount;
    public String curPage;
    public Items[] infoItems;

    public class Items {
        private String sID;
        private String location;
        private String unit;
        private String longitude;
        private String latitude;
        private String reason;
        private String time;
        private String dealContent;
    }

}

and read json

            ObjectMapper mapper = new ObjectMapper();
            UploadedInfoObjEx uploadedInfoObjEx = mapper.readValue(jsonString, UploadedInfoObjEx.class);

the error is

org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class com.rayboot.wl.object.UploadedInfoObjEx$Items]: can not instantiate from JSON object (need to add/enable type information?)

at [Source: java.io.StringReader@4150c480; line: 1, column: 81] (through reference chain: com.rayboot.wl.object.UploadedInfoObjEx[“infoItems”])

anyone could help me?
thanks

  • 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-14T01:58:42+00:00Added an answer on June 14, 2026 at 1:58 am

    I think you need to make the variables in your Items class public. You may also need to make it static:

    public static class Items {
        public String sID;
        public String location;
        public String unit;
        public String longitude;
        public String latitude;
        public String reason;
        public String time;
        public String dealContent;
    }
    

    If that doesn’t work you could try moving Items to its own file.

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

Sidebar

Related Questions

My JSON looks like this- {ipinfo: { ip_address:4.2.2.2, ip_type:Mapped, Location:{ continent:north america, latitude:33.499, longitude:-117.662,
I have a JSON like this { id:1, name:Jack, parent.id:2 } Note the dot
I have JSON like this: { something: http://something.com } and HTML like this: <a
I have a REST service that returns a JSON like this: [{@id:123,name:Name}] and I'm
I have a view model coming from the server as json like this {
I have a json string like this: { d: { results: [ { __metadata:
I've json array like this: {GetReportResult: [ {bulan:4,total:2448,type:CHEESE1K,uang:8847823}, {bulan:4,total:572476,type:ESL,uang:5863408410}, {bulan:4,total:46008,type:ESL500ML,uang:234498301}, {bulan:5,total:5703,type:CHEESE1K,uang:134929306}, {bulan:5,total:648663,type:ESL,uang:6645764498}, {bulan:5,total:51958,type:WHP,uang:631994613}, {bulan:6,total:6190,type:CHEESE1K,uang:104527773},
I am getting json response like this {item_id:1,item_title:Item 1}{item_id:2,item_title:Item 2} how would I parse
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19

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.