Questions tagged [json-simple]

JSON.simple is a Java-to-JSON binding API that serializes and deserializes JSON data to and from Java data structures.

JSON.simple is a Java-to-JSON binding API designed to be a simple Java toolkit to encode or decode JSON text.

See also:

234 questions
3
votes
1 answer

JSON: "Unexpected character (<) at position 0"

Here's the twitch.tv api request to get channel summary: http://api.justin.tv/api/streams/summary.json?channel=mychannel. If I post it via browser, I get correct results. But programmatically I receive an exception during result parsing. I use…
Dragon
  • 2,431
  • 11
  • 42
  • 68
3
votes
4 answers

json-simple Trying to get specific value from JSON

I'm trying to geocode an address and get the lat/lng coordinates in java. I'm able to geocode the address and have it return in a json object, but I'm unable to figure out how to use json-simple to parse the json below to get the lat/lng. Any help…
Catfish
  • 18,876
  • 54
  • 209
  • 353
3
votes
2 answers

How to handle a null value in JSON-Simple?

I'm ingesting tweets in JSON using JSON-Simple. I split the user object off into it's own JSONObject class, in memory: incomingUser = (JSONObject) incomingTweet.get("user"); Then I'm stripping off various fields from the tweet and the user objects…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
2
votes
1 answer

Create a JSONObject in a JSONArray (JSON-Simple / JAVA)

So, I'm getting a lot of troubles with adding a new JSONObject in my JSONArray. My code is in Spanish, so I'll try to traduct variables&methods to English in my comments the best I can. This is my .JSON (the default user has all the attributs as…
Mamey
  • 81
  • 1
  • 10
2
votes
1 answer

reading from a json file in java

Hello I have been trying to read a JSON file in java using the json.simple library, I read more than a dozen of tutorials on how to do this but in the end the way my JSON file is written is causing me a lot of trouble. { "0": { "POI":…
Sakis
  • 31
  • 12
2
votes
0 answers

Parsing JSON objects from .txt file

I have a txt file that contains multiples Json objects (let say 10), I got this file through an http request. I'm trying on java to get all the Json objects (the 10 differents JSON objects) contained in that file but I can't do it, as I don't know…
Youcef B
  • 47
  • 2
2
votes
1 answer

Getting an error that Package does not exist in eclipse java [ERROR]

I am getting an error that package does not exist in Eclipse Oxygen Java even though the package is imported I looked at this link: Package Does Not Exist - Eclipse. This did not help me. The .jar is in my build path but when I build it still gives…
m4nik 1
  • 39
  • 1
  • 3
2
votes
2 answers

Using Json-simple to parse an array of objects from a file

I am having issues parsing an array of json objects using json-simple. suppose the following array of report objects: [ { "title": "Test Object 1", "description": "complicated description...", "products": null, "formats": ["csv"] …
StillLearningToCode
  • 2,271
  • 4
  • 27
  • 46
2
votes
1 answer

Add a name to JsonArray or JsonObject using Java [ json-simple.jar library]

First of all i am using json-simple-2.1.2.jar[ Link on GitHub ]. It is similar to json-simple-1.1.1.jar but some classes are updated and some some other are deprecated but the logic is the same. Java code [It produces the below] //JSON Array…
GOXR3PLUS
  • 6,877
  • 9
  • 44
  • 93
2
votes
1 answer

Appending entry into JSON array with JSON-simple

I'm having trouble appending to a JSON file. I can add the new entry but not insert it into the correct position. Code: public static void main(String args[]) throws Exception { { File file = new File("jsonFormatting.json"); if…
quid pro quo
  • 23
  • 1
  • 4
2
votes
0 answers

json-simple ".jar; error in opening zip file" error

I've searched through a great deal of posts regarding including jar files with a java file using linux (Ubuntu) and javac, while I've had some luck in finding how to do it, I haven't had any luck getting it to work (best response was here: How to…
Hans
  • 531
  • 1
  • 4
  • 19
2
votes
3 answers

adding maven dependency causing java.lang.ClassNotFoundException

I have an application which is working fine until I have introduced the following maven dependencies. joda-time joda-time 2.3
2
votes
2 answers

json-simple versus jackson for parsing json when do not have obj type

To convert json String to pojo using jackson API can use : String jsonInString = "{\"age\":33,\"messages\":[\"msg 1\",\"msg 2\"],\"name\":\"mkyong\"}"; User user1 = mapper.readValue(jsonInString, User.class); This requires that create class User…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
2
votes
1 answer

Parse multiple of the same key JSON simple java

I'm not an expert at JSON so I'm not sure if I'm missing something obviously. But, what I'm trying to do is to parse…
TotallyGamerJet
  • 339
  • 1
  • 2
  • 12
2
votes
1 answer

parse json string using simple-json

I have read the posts that appeared to be the same as my question but I must be missing something. My environment is Eclipse Mars. My JAVA is 1.7 and I have imported json-simple. I simply wish to parse the json that is returned from my web…
MikeReynolds
  • 325
  • 2
  • 6
  • 13
1 2
3
15 16