theartha
asked on
JSON Exception: Unterminated string at character
Hi There,
I received this exception while pulling all the data into JSON format.
net.sf.json.JSONException: Unterminated string at character 894195 .....
at net.sf.json.util.JSONToken er.syntaxE rror(JSONT okener.jav a:512)
at net.sf.json.util.JSONToken er.nextStr ing(JSONTo kener.java :244)
at net.sf.json.util.JSONToken er.nextVal ue(JSONTok ener.java: 352)
at net.sf.json.JSONArray._fro mJSONToken er(JSONArr ay.java:11 58)
at net.sf.json.JSONArray.from Object(JSO NArray.jav a:147)
at net.sf.json.util.JSONToken er.nextVal ue(JSONTok ener.java: 358)
at net.sf.json.JSONArray._fro mJSONToken er(JSONArr ay.java:11 58)
at net.sf.json.JSONArray._fro mString(JS ONArray.ja va:1224)
at net.sf.json.JSONArray.from Object(JSO NArray.jav a:149)
at net.sf.json.JSONArray.from Object(JSO NArray.jav a:127)
any clues?
Please advice.
Thanks.
I received this exception while pulling all the data into JSON format.
net.sf.json.JSONException:
at net.sf.json.util.JSONToken
at net.sf.json.util.JSONToken
at net.sf.json.util.JSONToken
at net.sf.json.JSONArray._fro
at net.sf.json.JSONArray.from
at net.sf.json.util.JSONToken
at net.sf.json.JSONArray._fro
at net.sf.json.JSONArray._fro
at net.sf.json.JSONArray.from
at net.sf.json.JSONArray.from
any clues?
Please advice.
Thanks.
Well - it's pretty clearly telling you what the error is ;) Please post the string
Can you please post the code snippet?
ASKER
@CEHJ: Data is huge and sensitive, is there any way that I can find out the 894195 th character.
What os are you using?
ASKER
@CEHJ: Windows XP Professional
You could put the string in a file and use an editor that shows the offset
ASKER
@CEHJ: I used editplus, but couldn't figure it out. Is there any better editor?
notepad++, textpad are other good text editors.
ASKER
@CEHJ,cmalakar:
I figured out the location:
["A","B","C","O","E","null ","null"]
["A","B","C"," ","E","null","null"]
In the first JSON String at character "O", but in the second string at the same location. its empty string.
because of that empty string I am getting an exception.
Please advice.
I figured out the location:
["A","B","C","O","E","null
["A","B","C"," ","E","null","null"]
In the first JSON String at character "O", but in the second string at the same location. its empty string.
because of that empty string I am getting an exception.
Please advice.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.