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
0
votes
1 answer

json-simple not parsing complete json

I have a very long JSON which I need to parse using Google's json-simple APIs. However, json-simple APIs is not parsing the complete JSON string. Below is my Java code to parse the JSON. The output does not have complete JSON string. Is there any…
0
votes
2 answers

Java Syntax: JSONArray array = (JSONArray)obj

I'm learning to Decode JSON files in Java and have come across some Syntax I do not understand. I am also new to Java. Here is the code snippet: Object obj = JSONValue.parse(jsonResult); JSONArray array = (JSONArray)obj; In my best attempt at…
sully_r
  • 131
  • 1
  • 4
  • 14
0
votes
1 answer

JSONParser.parse() error

I have been getting a error parse my JSON file Input {"continent":"South America","recentJobRank":717,"latitude":"-34.6037232","lastSeenDate":"2012-11-23","start":"Inmediato","contactPerson":"Alejandra…
0
votes
0 answers

Read CSV value inside JSON file

I have a problem where I have to read a JSON File and extract a large CSV value from one of the attributes, process it ( get some overall information like CSV number of rows , columns... ) and then save it to the database. For this I am using…
0
votes
2 answers

Parsing Json Numerical Values In Java

My Java program takes a JSON string as an argument and parses it. I am using json-simple parser. Here is the link to it. I am trying to pass the following JSON string as an argument to the program. { "obj":"timeout" , "valInMs":15000 } I am…
davison
  • 335
  • 1
  • 3
  • 16
0
votes
0 answers

Not able to initialize JSONObject or JSONArray in eclipse

I am new to JSON programming. I am trying to write a webservice to fetch data from a SQLite table and write the output to a JSON file. I have added the JSON simple jar to my eclipse project. When I add a line of code as shown below, JSONObject obj =…
0
votes
1 answer

Internal error flushing the buffer in release() in jsp when writing custom output

I m writing json data using the json simple library here Now the code runs fine and im able to get the output. the code being - <%@page contentType="application/json" pageEncoding="UTF-8" import="org.json.simple.JSONObject"%> <% JSONObject json =…
Pradyut Bhattacharya
  • 5,440
  • 13
  • 53
  • 83
0
votes
1 answer

Access values of JSON objects from a JSON array in Servlet (JAVA)

I am stuck here for two days, trying to read values of JSONobjects stored in JSONArray. I use JSON simple, its not helping out alot! I only can get to the JSONArray elemts that hold the JSONObjects by something like this…
TyJS
  • 1
  • 3
0
votes
1 answer

Cant include json-simple-1.1.1.jar

I try compile following code (file Main.java): import org.json.simple.JSONObject; public class Main { public static void main (String[] args) { JSONObject obj = new JSONObject(); obj.put("name", "foo"); obj.put("num", new…
0
votes
0 answers

Unable to import json simple's .jar file into JSP file

I have copied the json-simple-1.1.1.jar into the WEB-INF/lib folder. In index.jsp, I am writing: <%@ page import="org.json.simple.parse.JSONParser" %>. But this gives me the error: An error occurred at line: 17 in the generated java file Only a…
Aditya M P
  • 5,127
  • 7
  • 41
  • 72
0
votes
1 answer

Deploying JSON payload to server

I'm attempting to make an API call to a server that requires a JSON payload, and returns one as well. //Prereq: username/password are string variables, this.url is a URL() HttpURLConnection http = (HttpURLConnection)…
Rogue
  • 11,105
  • 5
  • 45
  • 71
0
votes
2 answers

Android HTTP-POST

I am new to HTTP-POST. I have a site "http://otu-git.dyndns.ws/pvm_srv/echo_json.html" where I can put { "USR": { "fun":"validarUsuario", "txtUser":"123", "md5Passwd":"123" } …
Dhiraj Tayade
  • 407
  • 3
  • 10
  • 22
0
votes
1 answer

JSON-Simple get array based on contents

So, I have a JSON file where I want to load an array within the main object, so I load it with: try { schemaData = (JSONObject) parser.parse(new FileReader(schema)); schemaItemDataArray = (JSONArray) schemaData.get("items"); } catch…
0
votes
1 answer

JSON-SIMPLE Can't cast to object to read through array

I'm trying to use JSON-Simple to read a configuration file that's in JSON using the following code File f = new File("config.json"); JSONParser parser = new JSONParser(); try { int i; StringBuilder out = new…
Luke
  • 15
  • 4
0
votes
1 answer

Json-Simple , Cast Exception

please find my code below. When I run this I'm getting org.json.simple.JSONObject cannot be cast to org.json.simple.JSONArray exception. please help. I'm trying to print all the values inside the JSON public static void main(String[] args) throws…
Abhi
  • 899
  • 3
  • 10
  • 20