Android Question JSON.NextObject org.json.JSONException:Unterminated array

rafaelcamara

Member
Licensed User
Longtime User
Hello my friends,
I need a help, I'm having trouble parsing with the JSONparser object, it's returning this exeption org.json.JSONException: Unterminated array at 11585 character when executing json.NextObject, but not always, there are times when it can do it right The same string with the same information, am inserting into this string a member of a table with 11900 records what can be be due to the size of the string or the number of bytes sent?

'''''''''

Sub AStreams_NewText(Text As String)

If conect.sf.Trim(Text) <> "" Then

Dim msg As String
msg = Text

Dim m As Map
json.Initialize(msg)
m = json.NextObject


exeption;

org.json.JSONException: Unterminated array at character 11585 of {"aparelho":"358402072290303","IBPT":[{"codigo":"0101","tabela":"2","aliqnac":"17.59","aliqimp":"18.19"},{"codigo":"01012100","tabela":"0","aliqnac":"26.75","aliqimp":"27.35"},{"codigo":"01012900","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01013000","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01019000","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"0102","tabela":"2","aliqnac":"17.59","aliqimp":"18.19"},{"codigo":"01022110","tabela":"0","aliqnac":"14.80","aliqimp":"15.40"},{"codigo":"01022190","tabela":"0","aliqnac":"14.80","aliqimp":"15.40"},{"codigo":"01022911","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01022919","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01022990","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01023110","tabela":"0","aliqnac":"14.80","aliqimp":"15.40"},{"codigo":"01023190","tabela":"0","aliqnac":"14.80","aliqimp":"15.40"},{"codigo":"01023911","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01023919","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01023990","tabela":"0","aliqnac":"14.80","aliqimp":"16.50"},{"codigo":"01029000","tabela":"0","aliqnac":"14.80","aliqimp":"15.40"},{"codigo":"0103","tabela":"2","aliqnac":"17.25","aliqimp":"17.85"},{"codigo":"01031000","tabela":"0","aliqnac":"26.75","aliqimp":"27.35"},{"codigo":"01039100","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01039200","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"0104","tabela":"2","aliqnac":"15.84","aliqimp":"16.44"},{"codigo":"01041011","tabela":"0","aliqnac":"16.11","aliqimp":"16.71"},{"codigo":"01041019","tabela":"0","aliqnac":"16.11","aliqimp":"16.71"},{"codigo":"01041090","tabela":"0","aliqnac":"16.11","aliqimp":"17.81"},{"codigo":"01042010","tabela":"0","aliqnac":"16.11","aliqimp":"16.71"},{"codigo":"01042090","tabela":"0","aliqnac":"16.11","aliqimp":"17.81"},{"codigo":"0105","tabela":"2","aliqnac":"16.37","aliqimp":"16.97"},{"codigo":"01051110","tabela":"0","aliqnac":"16.11","aliqimp":"16.71"},{"codigo":"01051190","tabela":"0","aliqnac":"16.11","aliqimp":"17.81"},{"codigo":"01051200","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01051300","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01051400","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01051500","tabela":"0","aliqnac":"26.75","aliqimp":"28.45"},{"codigo":"01059400","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01059900","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"0106","tabela":"2","aliqnac":"18.13","aliqimp":"18.73"},{"codigo":"01061100","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01061200","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01061300","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01061400","tabela":"0","aliqnac":"25.45","aliqimp":"28.20"},{"codigo":"01061900","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01062000","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01063100","tabela":"0","aliqnac":"25.45","aliqimp":"28.20"},{"codigo":"01063200","tabela":"0","aliqnac":"25.45","aliqimp":"28.20"},{"codigo":"01063310","tabela":"0","aliqnac":"25.45","aliqimp":"26.05"},{"codigo":"01063390","tabela":"0","aliqnac":"25.45","aliqimp":"28.20"},{"codigo":"01063900","tabela":"0","aliqnac":"25.45","aliqimp":"28.20"},{"codigo":"01064100","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01064900","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"01069000","tabela":"0","aliqnac":"26.75","aliqimp":"29.50"},{"codigo":"0107","tabela":"2","aliqnac":"16.81","aliqimp":"17.41"},{"codigo":"0108","tabela":"2","aliqnac":"18.16","aliqimp":"18.76"},{"codigo":"0201","tabela":"2","aliqnac":"17.13","aliqimp":"17.73"},{"codigo":"02011000","tabela":"0","aliqnac":"8.11","aliqimp":"13.81"},{"codigo":"02012010","tabela":"0","aliqnac":"8.11","aliqimp":"13.81"},{"codigo":"02012020","tabela"
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

rafaelcamara

Member
Licensed User
Longtime User
So DonManfred, it's really not that tring got too big (Message longer than Log limit (4000). Message was truncated.) It only returns 4000 characters, II already checked with a msgbox and it returned everything correctly, so much so that there are times when the same information Generate direct. I'm finding that when running json.initialize (msg) for too much registry it can not generate the object, does it proceed?
 
Last edited:
Upvote 0

eps

Expert
Licensed User
Longtime User
As @DonManfred said there is an error in the json, the online tool reported

"
Error parsing string:
org.json.JSONException: Expected ':' after c: at character 40963 of {"aparelho":"358402072290303","IBPT":
"
 
Upvote 0
Top