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.
Questions tagged [jsonexception]
171 questions
0
votes
1 answer
Expected BEGIN_OBJECT but was BEGIN_ARRAY with retrofit
How can I parse this using Retrofit?I'm getting the error
BEGIN_OBJECT but was BEGIN_ARRAY
The Json is below and it contain a results array object, that have one array object which is null and objects of information. It seems like that array of…
0
votes
3 answers
JSONException String cannot be converted to JSONObject
I am trying to convert string to JSONObject. This is my code:
JSONObject obj = new JSONObject(str);
Vehicle.feature file contains :
Scenario: Create a vehicle with valid json request
Given vehicle json for VehicleService
"""
…

Rubal Jain
- 87
- 2
- 11
0
votes
1 answer
org.json.JSONException: Value success of type java.lang.String cannot be converted to JSONObject
I am having a problem to understand what am I missing on my server side. I am sending a firebase function delete request to my Node JS server from Android client side and when printing to console everything looks fine and works synchronously and…

Alon Shlider
- 1,187
- 1
- 16
- 46
0
votes
1 answer
GSON: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
While working on retrofit, I used http://www.jsonschema2pojo.org this site to convert json to POJO. But I got an error while parsing JSON like this. Its saying Expected BEGIN_OBJECT but was BEGIN_ARRAY.
[
{
"uuid":…

Rahul Pathak
- 91
- 1
- 9
0
votes
0 answers
why am i getting this "E/org.json.JSONException: End of input at character 0 of: onErrorResponse:" error?
I am sending a post request to the server using volley library from android device to the spring backend. This post request is for registering the new user. Every thing works fine as intended the post request is sent to server the server accepts the…

javaNoob
- 86
- 1
- 9
0
votes
2 answers
How to fix JSONException: Index 0 out of range [0..0)?
I am trying to fetch lat and lng of the orderRequest address to show the admin from where the OrderRequest is coming.
private void drawRoute(LatLng yourLocation, String address) {
mServices.getGoeCode(address).enqueue(new Callback() {
…

Muhammad Saleh
- 29
- 5
0
votes
1 answer
JSONException since Android Api 28 (String result = "")
Upgraded to Android Api 28. Now im getting an curios JSONException. Actually its not clear how I can solve the problem. I know why this is happen, but I don't know how to fix it at this time.
This part should produce the error "String result = "";"…
user5301308
0
votes
1 answer
W/System.err: org.json.JSONException: Value Could of type java.lang.String cannot be converted to JSONArray
Although the question has been answered but the solution is not working for me. I'm using Volley library here. I'm getting response from the server as well but this is still causing the problem. Can u guys please tell me what I'm doing wrong?
My…

Rajveer Bedi
- 23
- 8
0
votes
1 answer
Android : org json jsonexception no value for
i use this json url :
https://www.theaudiodb.com/api/v1/json/1/search.php?s=coldplay
{
"artists": [
{
"idArtist": "111239",
"strArtist": "Coldplay",
"strArtistStripped": null,
"strArtistAlternate": "",
…

Hossein
- 73
- 1
- 8
0
votes
1 answer
org.json.JSONException in volley
I am parsing json using volley but its not working and getting error. Follwing is my code and json reponse. please help me to solve this
private void getStaffList() {
showpDialog();
RequestQueue requestQueue =…

chris
- 699
- 4
- 12
- 35
0
votes
3 answers
Error while Reading and Parsing JSONArray String from SharedPreference
I have stored JSONArray as a String in SharedPreference.This is my JSONObject
JSONObject info = new JSONObject();
try {
info.put("name", full_name);
info.put("phone", foodie_contact);
…

Satyam Gondhale
- 1,415
- 1
- 16
- 43
0
votes
2 answers
JSONException while using last.fm API in android
JSON :
{"results":{"opensearch:Query":{"#text":"","role":"request","searchTerms":"Rose","startPage":"1"},"opensearch:totalResults":"102325","opensearch:startIndex":"0","opensearch:itemsPerPage":"1","artistmatches":{"artist":[{"name":"Guns N'…

raven
- 115
- 1
- 9
0
votes
1 answer
How to format JSONArray with nested arrays
I wannt to access the fields in my JSONArray. The nested brackets inside the JSONArray is very troublesome. I can't see how this format is an acceptable JSONArray return value. I get an JSONException when I try to access a field (eg…

I Like
- 1,711
- 2
- 27
- 52
0
votes
1 answer
Can't set up java web service to display SQL Server data
so I'm trying to write a java web service via Eclipse to expose some SQL Server data in XML format
I've some how managed to write a script that returns the SQL Server query results I want
I've also some how managed to set up a basic java web service…

user3120554
- 641
- 2
- 11
- 21
0
votes
1 answer
Unable to send deserialized data to a Web API
I am trying to use an API which I have used previously for various jobs, to query and get me relevant data. But lately, I am unable to do that because of an unusual exception returned, which I honestly have no idea about.
The CODE:
import…

Devanshu Misra
- 773
- 1
- 9
- 28