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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:37:13+00:00 2026-05-27T06:37:13+00:00

I have a JSON string : [{\is_translator\:false,\follow_request_sent\:false,\statuses_count\:1058}] Using PHP’s json_decode() on the string and

  • 0

I have a JSON string :

"[{\"is_translator\":false,\"follow_request_sent\":false,\"statuses_count\":1058}]"

Using PHP’s json_decode() on the string and doing a print_r, outputs :

Array
(
    [0] => stdClass Object
        (
            [is_translator] => 
            [follow_request_sent] => 
            [statuses_count] => 1058
        )

)

This shows that it is valid JSON.

However using the Jackson Library gives an error :

Exception in thread “main”
org.codehaus.jackson.map.JsonMappingException: Can not deserialize
instance of java.util.LinkedHashMap out of START_ARRAY token at
[Source: java.io.StringReader@a761fe; line: 1, column: 1]

Here is the simple code :

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;

public class tests {
public static void main(String [] args) throws IOException{
    ObjectMapper mapper = new ObjectMapper();
    Map<String, Object> fwers = mapper.readValue("[{\"is_translator\":false,\"follow_request_sent\":false,\"statuses_count\":1058}]", new TypeReference <Map<String, Object>>() {});
    System.out.println(fwers.get("statuses_count"));

    }
}

Can someone tell me what is wrong and a solution?

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-05-27T06:37:13+00:00Added an answer on May 27, 2026 at 6:37 am

    “[{}]” is a list of hashes and you are trying to serialize to a hash. Try the following.

    List<Map<String, Object>> fwers = mapper.readValue(yourString, new TypeReference<List<Map<String, Object>>>() {})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following JSON string, encoded with PHP 5.2 json_encode(): {foo:\\.} This JSON
I have json string from here: http://vkontakte.ru/al_video.php?act=load_videos_silent&al=1&oid=8046830 I use Touch json parser. //received json
I have one JSON that is coming in a string format. I need to
I have a json string saved in my db. When i retrieve it from
I have converted my Datatable to json string use the following method... public string
I have a JSON array with ActiveRecord objects. These objects can be reconstructed using
I have a json string but the format is strange [[5706,[ [1132001,Aston Villa,West Ham,5706,'2010-08-14T15:00:00.0000000',[[1966752,0],[1977724,1]],[],,,,,64,63],
Hi I have a JSON string that looks like this (Usingt Rails and a
I have a web service that returns a decimal value into my json string
I am a javascript noob. I have a JSON string created by google gson

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.