Questions tagged [jackson]

Jackson is a Java library for handling tasks like reading and writing (parsing / generating) and data binding to/from Java objects. Although primarily used for JSON, Jackson also supports many other data formats such as Avro, CBOR, CSV, Java Properties, Protobuf, Smile, XML and YAML.

Jackson is a Java serialization and deserialization API typically used for reading and writing JSON, although other data formats such as Avro, CBOR, CSV, Java Properties, Protobuf, Smile, XML, and YAML are also supported. It offers multiple processing modes including "streaming", "data-binding" and "tree model"; of these, latter two builds on streaming processing.

The Jackson homepage is hosted on GitHub, and the project's Wiki is here.

Alternatives

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

Performance

The latest performance benchmarks for these and other JSON serialization and deserialization solutions for Java are available online.

16401 questions
7
votes
1 answer

jackson prints empty JSON string

I have a java program which should serialize objects using jackson (play framework). It was working, but I messed it up somehow and now I can't get it working. Here is my serializer public String serializeObject(Object object) { ObjectWriter ow…
xpg94
  • 495
  • 1
  • 10
  • 26
7
votes
2 answers

Jersey Jackson data entity filtering JsonMappingException on collection

I have an issue when trying to put in place the “selectable entity filtering”. I have an Abstract class like following one: // In your Pom org.glassfish.jersey.ext
user3774109
  • 1,978
  • 1
  • 12
  • 13
7
votes
4 answers

Infinite Recursion with Jackson JSON and Hibernate JPA issue (yet another)

I've found oodles of resources on this, such as this one - Infinite Recursion with Jackson JSON and Hibernate JPA issue. I've tried to implement all of the various suggestions described there (including basic @JsonIgnore), but to no avail. I can't…
swv
  • 691
  • 1
  • 12
  • 28
7
votes
0 answers

Spring Boot : Use custom object mapper/message converter based on end points

I want to configure custom message converters based on endpoints. For example, I have below two endpoints in Spring boot controller: @RequestMapping(value = "/all", method = RequestMethod.GET) public ResponseEntity
Darshan Mehta
  • 30,102
  • 11
  • 68
  • 102
7
votes
5 answers

spring-cloud-feign Client and @RequestParam with Date type

This time I was working with Declarative REST Client, Feign in some Spring Boot App. What I wanted to achieve is to call one of my REST API's, which looks like: @RequestMapping(value = "/customerslastvisit", method = RequestMethod.GET) public…
patrykos91
  • 3,506
  • 2
  • 24
  • 30
7
votes
3 answers

Jackson throwing errors

Trying to convert XML to JSON in STORM Trident My code worked fine in storm 0.9.1 version and now we upgraded to Latest Version of Storm 0.10.0 and we are getting the below errors if you have any idea on the cause please let me know? 11752…
RAJESH
  • 404
  • 6
  • 18
7
votes
1 answer

How to deserialize from json tree?

Suppose I have json tree already read. Is it possible to deserialize from it (without converting back to string)? public class TryDeserializeNode { public static class MyClass { private int x = 11, y = 12; public int getX() { …
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
7
votes
0 answers

What is the convenient way to deserialize JSON(links + embedded container) using spring-hateoas?

colleagues! We want to write Rest Client to service which follow the HATEOAS principle. So we have the following HAL+JSON representation and we want to deserialize it using spring-hateoas : { "id": "1", "title": "album title", …
7
votes
4 answers

Spring social facebook login error - Numeric value out of range of int

I have a problem using Spring Social, when I tried to login to Facebook, I get the following…
7
votes
2 answers

Spring Data Rest: RepositoryRestController deserialization from URI not working

My Problem is the deserialization of entities from URI-String. When I use the by Spring Data Rest generated HTTP interface everything works fine. I can post the following JSON against my endpoint /api/shoppingLists and it will be deserialized to a…
Yannic Bürgmann
  • 6,301
  • 5
  • 43
  • 77
7
votes
0 answers

Unnecessary Namespace in Jackson XML 2.6.1 + Woodstox 4.4.1

I'm trying to parse my object to XML using jackson-dataformat-xml and, when i set the root namespace and parse the file, all properties of my object in the XML gives a empty namespace xmlns="". On jackson's github docs, is advise to use woodstox…
Tiago Cássio
  • 301
  • 2
  • 5
7
votes
4 answers

skip malformed csv row

I have been trying to read a csv and add fields to a Data Structure. But, one of the row is not formed properly, and I am aware of that. I just want to skip the row and move on to another. But, even though I am catching the exception, It's still…
notacyborg
  • 115
  • 1
  • 11
7
votes
3 answers

Jackson cannot parse control character

In my API response, I have control-p character. Jackson parser fails to serialize the character and throws an error com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 16)): has to be escaped using…
June Woo Suk
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

Really long strings in JSON (>1 gig) with Jackson token stream

I'm trying to write some code processing JSON document with extremely long string values (longer than 1 billion characters) stored in file. I don't want to keep whole strings in memory (since I can process them in stream). But I can't find such…
rsutormin
  • 1,629
  • 2
  • 17
  • 21
7
votes
2 answers

How to ignore properties with empty values during deserialization from JSON

I'm trying to deserialize a JSON string into a ConcurrentHashMap object and I'm getting errors because my JSON contains properties with null values, but ConcurrentHashMap does not accept null values. Here is the fragment of code: ObjectMapper…
Radu Dumbrăveanu
  • 1,266
  • 1
  • 22
  • 32