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
122
votes
9 answers

conversion from string to JSON object Android

I am working on an Android application. In my app I have to convert a string to JSON Object, then parse the values. I checked for a solution in Stackoverflow and found similar issue here link The solution is like this …
sarath
  • 3,181
  • 7
  • 36
  • 58
16
votes
1 answer

Android - JSONException No value for

I know that there are several questions posted on here with the same topic and error, but none of them indicate the same problem as mine, so I decided to post my question here, hoping that someone would help me point out the cause. So I'm trying to…
huong
  • 4,534
  • 6
  • 33
  • 54
15
votes
1 answer

org.json.simple.JSONObject VS org.json.JSONObject , JSONException cannot be resolved to a type

First: can someone provide an explanation of the differences between org.json.simple.JSONObject and org.json.JSONObject? Second: I have a code with org.json.JSONObject and org.json.JSONException. When I edit the code in eclipse ( JUNO) it…
Cooper
  • 208
  • 2
  • 3
  • 10
8
votes
3 answers

In the JSON Response String contains auto-added Backslashes

I am calling a webservice to get a JSON string response and It contains backslashes which is not in original string. Below is my code for requesting a JSON string object which is: {"name":"Name","id":1} protected String…
Jahanzeb Khan
  • 81
  • 1
  • 1
  • 5
8
votes
4 answers

org.json.JSONException: Expected literal value at character 550 of

I am trying to read JSON file from asset folder. But I get the following exception: org.json.JSONException: Expected literal value at character 550 I searched lot of stuff but didn't find anything relevant. Here is my JSON file: { "resultCount":…
Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
7
votes
3 answers

How to use JSON Sanitizer at Server Side?

I want to implement the 'JSON Sanitizer' validation as mentioned by OWASP. My understanding is that this needs to be done in two places: JSON data (in Request) received from Client or Other Systems - This needs to be sanitized at Server side…
yathirigan
  • 5,619
  • 22
  • 66
  • 104
6
votes
1 answer

"Unrecognized token 'com': was expecting ('true', 'false' or 'null')"

I have converted this json to string to save in local database { "type": "file", "id": "b665ff0b-5f7b-4991-ae88-ac5054880223", "link": { "href":…
konda rahul
  • 141
  • 1
  • 1
  • 11
6
votes
1 answer

JSONException: Index 5 out of range [0..5)

I'm having some trouble with an App I'm developing right now that uses this JSON Object: http://api.worldweatheronline.com/premium/v1/marine.ashx?q=-34.8799074,174.7565664&key=3477e975c4d9a8a0eaac2b2c818f4&format=json&tide=yes Some days it works…
Makoto
  • 1,455
  • 4
  • 13
  • 17
5
votes
3 answers

java.lang.ClassNotFoundException: org.json.JSONException

I am building a simple maven project. I used build path to add json as a third party library and also added it to web-inf library. In the end, i added the dependency in pom.xml. However, with all the effort above, i still get this exception. Any…
zwlgator
  • 81
  • 1
  • 1
  • 5
4
votes
0 answers

Flutter http response is sometimes missing last one or two bytes

I have following code in my Flutter application: response = await http.post(uri, body: target.parameters, headers: headers); return SeatsMapDecoder.getFromJson(json.decode(response.body)); End the response for this request is something like…
clzola
  • 1,925
  • 3
  • 30
  • 49
4
votes
4 answers

.Net Core 3 and EF Core 3 Include Problem (JsonException)

I'm trying to develop an application using .NET Core 3 and EF Core. I encountered an error that I could not find a solution for. I could not do on ".Net Core 3" a structure which can be simply created with PHP eloquent. Model; public…
4
votes
1 answer

Parse Server bad json response error code 100

I am using this Parse Server Guide to create a local instance of parse server. I download and set up the example and it runs perfectly, but when i try to use the android SDK i get this error 02-12 22:41:58.662 …
christoandrew
  • 437
  • 4
  • 17
4
votes
1 answer

Android JSONArrays inside JSONArray

Here's the relevant part of my json file: "categories": [ [ "Belgian Restaurant", "belgian" ], [ "Brasserie", "brasseries" ] ], What i want to do is retrieve informations from the second…
clems36
  • 922
  • 1
  • 13
  • 26
4
votes
3 answers

org.json.jsonarray cannot be converted to jsonobject error

I have been trying to fix this error for 2 days now, searched and tried multiple coding types from stackoverflow.com. I have checked my JSON http://jsonformatter.curiousconcept.com/#jsonformatter. But I am still unable to find out why my code is…
Jayce
  • 781
  • 3
  • 16
  • 35
3
votes
2 answers

How to solve error in org.json.JSONException?

I'm creating an app that can retrieve the word by putting the ID number in the editText. I keep on getting this error. how to solve this problem? org.json.JSONException: No value for {"server_response": "Bird"} Here's my Main Activity.java package…
NeophyteCoder
  • 43
  • 1
  • 7
1
2 3
11 12