pvdung / quick-json

Automatically exported from code.google.com/p/quick-json
0 stars 0 forks source link

Crash in com.json.parsers.JsonParserFactory #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import Jar
2. Execute 
        JsonParserFactory factory=JsonParserFactory.getInstance();
        JSONParser parser=factory.newJsonParser();
        Map jsonData=parser.parseJson(inputJsonString);
 for string {"error": "0"}
3.

What is the expected output? What do you see instead?
The Android program crashes with java.lang.NoClassDefFoundError: 
com.json.parsers.JsonParserFactory
The program should not crash

What version of the product are you using? On what operating system?
Eclipse
Version: 1.4.1.v20120912-144938-8R7xFOXFLWUl7PpNBh_HIGkb4
Build id: M20130204-1200
Android Developer Tools
Build: {0}

Please provide any additional information below.

Original issue reported on code.google.com by fbarto...@gmail.com on 3 Aug 2014 at 10:37

GoogleCodeExporter commented 9 years ago
In particular I try to parse:

[{"taxiId":"44","availability":"1","allowance":"4","subscription":"2015-06-01","
license":"444","email":"fbartolom@gmail.com","password":"2b7da421e10506dc87f9e1a
7dd5caed5","playerID":"1","language":"it","activation":"1","online":"1","name":"
","latitude":"0.0000000000000","longitude":"0.0000000000000","description":"I 
am the 
developer","photo":"","carmodel":"","discount":"0","pricexkm":"0","year":"2001",
"airconditioned":"0","wifi":"0","places":"0","bancomat":"0","visa":"0","masterca
rd":"0","amex":"0","maestro":"0","diners":"0","taximeter":"1","freshness":"0","t
aximeterValue":"$0.00","token":"b42d6664f62d63f0a7f1e77be50a51bf19508f1d0678e3a6
df833fa073a2b58d","cooperative":"0","ncc":"0"}]

and get Error:
@Key-Heirarchy::root[0]/    @Key::name  Value is expected but found 
empty...@Position::241

Original comment by fbarto...@gmail.com on 3 Aug 2014 at 11:52

GoogleCodeExporter commented 9 years ago
It boils down to an already submitted issue. The strings were empty, when I 
filled it it did not crash any longer. How do I also handle the possibility of 
parsing empty values from the Json text?

Original comment by fbarto...@gmail.com on 3 Aug 2014 at 12:01

GoogleCodeExporter commented 9 years ago
Assuming I manage to turn all empty strings to null, I still do not obtain the 
parsed values. As a matter of fact I have no idea either how to print the whole 
output map to see its contents.

Original comment by fbarto...@gmail.com on 3 Aug 2014 at 12:27

GoogleCodeExporter commented 9 years ago
You can simply iterate through the map and print keys and values ...

As for your issue with empty strings: 
https://code.google.com/p/quick-json/issues/detail?id=11

Original comment by noack.mi...@googlemail.com on 23 Oct 2014 at 3:41