Questions tagged [json-lib]

JSON-lib is a Java-to-JSON binding API that serializes and deserializes JSON data to and from Java data structures. It also includes some support for translations between XML and JSON.

JSON-lib is a Java-to-JSON binding API, hosted at http://json-lib.sourceforge.net, designed for easy and customizable deserialization and serialization of JSON data to and from Java data structures. It also includes some support for translations between XML and JSON.

Alternatives

Alternative Java-to-JSON binding solutions with similar APIs include Jackson, Google Gson, and svenson. Yet more are listed at json.org.

Pros and cons of the different APIs are discussed in the https://stackoverflow.com/questions/338586/a-better-java-json-library post.

Performance

The latest performance benchmarks for these and other JSON serialization and deserialization solutions are available at https://github.com/eishay/jvm-serializers/wiki.

76 questions
1
vote
0 answers

Json string handling with back slash

I know this question was asked several times before on this forum. But none of it addresses my problem. I am using Jmeter to post json string with content-type "application/json" My Spring mvc app is happy consuming the same and converting it to…
sridhar kondoji
  • 103
  • 1
  • 9
1
vote
2 answers

Error parsing JSON in Java: ClassNotFoundException

I'm trying to parse a bit of JSON in Java by following this tutorial. Because it mentions nothing about org.apache.commons.io.IOUtils other than it imports it, I figured all it was used for it to convert an InputStream into a String. I have my own…
Novicode
  • 275
  • 2
  • 3
  • 12
1
vote
1 answer

Xml to Json to xml reversible conversion json-lib

I am trying to do reversible xml-json-xml generic conversion using json-lib which according to its documentation does the conversion as described in Converting Between Xml And Json. According to the document: A structured XML element can be…
vishr
  • 985
  • 10
  • 28
1
vote
1 answer

What is the difference between putAll(Map map) and accumulateAll(Map map) method of json-lib?

JsonObjectclass of Library json-lib-2.2.3(net.sf.json) has two methods : public void putAll( Map map ) AND public void accumulateAll( Map map ) I have to put all map details in JSONObject. Which method should i use and why(i.e What is the…
Prateek
  • 12,014
  • 12
  • 60
  • 81
1
vote
1 answer

Issue with conversion from XML to JSON with json or json-lib

I am having xml containing some html content in some node like <P>Students should avoid purchasing their textbooks at the first store that they browse. Instead, they should investigate the alternatives offered by other online…
Pankaj Kathiriya
  • 4,210
  • 2
  • 19
  • 26
1
vote
1 answer

read multiple json objects from a text file using json lib

Hi i am very much new to this json stuff,i have a requirement like reading json data from a text file.i could able to read only a single object but i want multiple objects to be read.please help me on this. this is my json format in the text file { …
user1585111
  • 1,019
  • 6
  • 19
  • 35
1
vote
1 answer

not able to add json-lib dependency to pom

I am trying to add json-lib dependency to pom, but it is freaking out saying that 'Missing artifact net.sf.json-lib:json-lib' dependency: net.sf.json-lib
user1772643
  • 615
  • 3
  • 11
  • 23
1
vote
2 answers

Undesired output from json-lib with string that appears to be an array

I have code that looks something like this: import net.sf.json.*;--just so you know what the library is ... JSONArray a = new JSONArray(); JSONObject p = new JSONObject(); p.put("some_attribute1","some normal…
Reimius
  • 5,694
  • 5
  • 24
  • 42
1
vote
2 answers

JSON Nested data creation failing in Java

import net.sf.json.*; public class JSONDemo { /** * @param args */ public static void main(String[] args) { JSONObject mainObj = new JSONObject(); JSONObject jObj1 = new JSONObject(); JSONObject jObj2 = new JSONObject(); …
nikhilvora
  • 491
  • 1
  • 7
  • 19
1
vote
0 answers

Play Framework: how to resolve failure to download a JSON-LIB dependent library?

I am working with Play Framework 1.2.4, and using JSON-LIB to parse some JSON data from Java code. Initially, I just put the 'json-lib-2.4-jdk15.jar' into the 'lib' folder, and the application worked fine. At some point, I got that this is not the…
Max
  • 643
  • 11
  • 27
0
votes
1 answer

how to make Json lib generate such string: \/Date(1317375052044)\/

My target is to generate such json string: {"EndTime": "\/Date(1309737600000)\/"} I define a HashMap to generate the string If I define the string value as "\\/Date(1317375052044)\\/" then the result is "\\\\/Date(1317375052044)\\\\/". If I define…
Xilang
  • 1,513
  • 3
  • 18
  • 36
0
votes
0 answers

Could not find json-lib-2.2.3.jar (net.sf.json-lib:json-lib:2.2.3)

It's my gradle projects with the following error details: Could not find json-lib-2.2.3.jar (net.sf.json-lib:json-lib:2.2.3). Searched in the following locations: …
Da Vinci
  • 1
  • 1
0
votes
0 answers

Can't install jsonlib with pip

Due to Error 1 (below) I've downloaded an installer via the URL at the last line of the error. "Visual Studio Build Tools 2022 - 17.4.4" window has popped up with many options of things to install so I just choose "C++" as it said. Then when I try…
sw016428
  • 11
  • 1
  • 3
0
votes
1 answer

jsonserializer.serialize library failed

public class Product { public int Id { get; set; } public string ProductName { get; set; } public int Quantity { get; set; } } public IActionResult Index() { var products = new List
0
votes
0 answers

undefined reference to `Json::Value::'

this is a following question to this question after re install libjsoncpp-dev and add #include i'm getting: undefined reference to `Json::Value::every_method'
Guy Sadoun
  • 427
  • 6
  • 17