Questions tagged [jsonexception]

Java Exception that is thrown to indicate a problem with the JSON API, as attempts to parse or construct malformed documents, use of null as a name or type mismatches on lookups.

171 questions
1
vote
2 answers

Extract JSON objects using Scala (Have Duplicates Keys)

Have a sample JSON like below which has duplicate keys with field context : { "Production": { "meta_id": "1239826", "endeca_id": "EN29826", "Title": "Use The Google Home ™ To Choose The Right CCCM Solution For Your…
Raghavan
  • 313
  • 2
  • 10
1
vote
0 answers

Java Arraylist is not able to deserialize instance out of START_OBJECT token

Getting the error: java.lang.IllegalArgumentException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token java.lang.IllegalArgumentException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT…
1
vote
0 answers

"org.json.JSONException: Unterminated string at character" while parsing String to JSONArray

While passing one special use case of String to JSONArray, getting the below error as: org.json.JSONException: Unterminated string at 25 [character 26 line 1] My code is as below: public Object parseResponse(String msg) { JSONArray…
Amit Agarwal
  • 67
  • 1
  • 1
  • 12
1
vote
3 answers

org.springframework.core.codec.DecodingException: JSON decoding error: Illegal character ((CTRL-CHAR, code 31))

I am getting the following error getting a response of a post method via WebClient(org.springframework.web.reactive.function.client) org.springframework.core.codec.DecodingException: JSON decoding error: Illegal character ((CTRL-CHAR, code 31)):…
Nilotpal
  • 3,237
  • 4
  • 34
  • 56
1
vote
3 answers

How to trigger JsonProcessingException for Java Unit Test?

I have a method in a class called "HttpResponseHelper" that I am trying to Unit Test when it throws a JsonProcessingException, but I was having difficulties getting it do so: private static void populateHTTPResponseWithData(ObjectNode…
ennth
  • 1,698
  • 5
  • 31
  • 63
1
vote
0 answers

When given Json file names as input "org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]"

When given Json file names as input "org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]" ` The following files are used in the below code. JSONObject output1 = new JSONObject("E:\\Bharathi\\json sample…
1
vote
1 answer

Google Books Api - No value for imageLinks - Android JSONException

I'm using Google Books Api to show list of books, but when I try to get thumbnail url from imageLinks JSONObject, then the JSONException says that there's no value for imageLinks even though the value exists in this object. I tried methods like…
rradzzio
  • 13
  • 1
  • 4
1
vote
2 answers

Incorrect JSONException

I'm trying to use JSON objects from the Guardian API. This is the result from my call: https://pastebin.com/wqggLEeZ This is my code JSONObject root = new JSONObject(jsonData); JSONArray resultArray =…
Uzer
  • 187
  • 2
  • 3
  • 15
1
vote
1 answer

Java value of type java.lang.string cannot be converted to jsonobject

I have an API (here) that outputs a JSON string as output. I want to parse this JSON. It was working a while ago, but I might have changed something in my API or java code. This is the code I'm using: Here, msg is a string which contains the api…
mrid
  • 5,782
  • 5
  • 28
  • 71
1
vote
1 answer

How to write a LIKE Statement in PHP Query?

I'm creating an app that can retrieve the word by using the last letter of the inputted word. For example in my case on my existing database the sequence is Apple > Elephant > Train > Nerve > Education > Newspaper > and I will input Recipe because…
NeophyteCoder
  • 43
  • 1
  • 7
1
vote
0 answers

exception org.json.JSONexception is never thrown in corresponding try block

I'm getting an error like exception org.json.JSONexception is never thrown in corresponding try block. Whenever I try to remove the try catch block, the entire jsonobjectrequest() function is getting thet error. When I try to remove the…
SHINTO JOSEPH
  • 377
  • 4
  • 17
1
vote
2 answers

JSONException not caught

I have this piece of code: HJRestClient.post(path, params, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { try { JSONArray array =…
Abdullah Umer
  • 4,234
  • 5
  • 36
  • 65
1
vote
2 answers

How to make string campatible for JSON.parse()

In my application when I enter value as my"name in text field the framework makes a String like (this i can not control): "[{\"id\":\"201500000001002\",\"name\":\"my\"name\",\"colorCode\":\"\",\"version\":\"11\",\"nodeOrder\":\"1\"}]" Now this…
quintin
  • 812
  • 1
  • 10
  • 35
1 2
3
11 12