Questions tagged [jackson-modules]
177 questions
4
votes
1 answer
java.lang.ClassNotFoundException Spark Scala
I have a simple Spark program in scala with following code but get the exception.All im trying to do is run the main code.
I have also included the gradle config.
Any help will be appreciated.
Error:-
Exception in thread "main"…

Kaustubh Walokar
- 71
- 1
- 4
4
votes
1 answer
What is Class> vc or JavaType valueType used for in the constructor of Jackson's StdDeserializer
I am making a custom deserializer (extending StdDeserializer) using the Jackson JSON library and I can't figure out what the purpose of the constructor parameters are. What is Class> or JavaType valueType used for by Jackson? Is it just because…

zjuhasz
- 1,489
- 12
- 30
4
votes
1 answer
jackson's @JsonIdentityInfo with breadth first
I am using Jackson's @JsonIdentityInfo for removing circular objects from JSON.
Suppose following is Java Classes
Class A, B, C
and following is structure,
Class A{
int id;
B b;
C c;
}
Class B{
int id;
C c;
}
My object is …

Akshay
- 3,558
- 4
- 43
- 77
4
votes
2 answers
Jackson JDK8 Data Type and Parameter Names modules don't play together
It seems to me Jackson JDK8 Data Type module occasionally ignores Parameter Names module which seems a little bit surprising, given that both demand JDK8 and solve specific-use cases with regards to JDK8.
The issue here is that I could not find a…

quantum
- 3,000
- 5
- 41
- 56
4
votes
0 answers
How to deserialize String array with embedded null using Jackson with Scala module?
I have the following Scala case class:
case class InteractionPersona(
id: String,
geo: Option[(Option[String], Option[String], Option[String])])
Using Jackson, when I serialize an instance of the class:
val persona =…

François Beausoleil
- 16,265
- 11
- 67
- 90
4
votes
1 answer
Register JodaModule in Jax-RS Application
I'm writing a Jax-RS application using Jersey, and Jackson2 under the hood to facilitate JSON i/o. The service itself works fine, but I'd like to improve it by having the Jackson mapper automagically serialize/deserialize date and date-times to…

JHarnach
- 3,944
- 7
- 43
- 48
4
votes
2 answers
CharConversionException in parsing CSV file using Jackson's CSV data format module
I am trying to parse CSV file using Jackson's CSV data format module.
I tried sample code given on their project homepage (https://github.com/FasterXML/jackson-dataformat-csv)
CsvMapper mapper = new…

Alok
- 7,734
- 8
- 55
- 100
4
votes
4 answers
Jackson: json schema references other schemas, can this be disabled?
When I use Jackson Json-Schema-Module, my schemas are generated using references that are pointed to each other.
Consider this schema:
This is a property object inside POJO1
"myObject" : {
"type" : "object",
"id":…

vlashel
- 345
- 2
- 15
4
votes
1 answer
@JsonCreator and mixin via Module not working for 3rd Party Class
I am trying to deserialize java.net.HttpCookie which doesn't have a default no-arg constructor and am getting:
org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class java.net.HttpCookie]: can not…

Matt P.
- 193
- 3
- 9
4
votes
0 answers
Jackson tries to serialize lazy loaded objects and throws " org.hibernate.LazyInitializationException - failed to lazily initialize ..."
My environment
jackson-datatype-hibernate 2.3.2
Spring-webmvc 3.2.6
Hibernate 4.3.4
So basically my application is supposed to return a list of serialized corporations.
The corporation class has a set of traveller objects which are lazy…

jaybe78
- 363
- 4
- 18
4
votes
2 answers
Is there a way that i can unregister a module from Jackson ObjectMapper?
I'm registering KeyDeseriliser to ObjectMapper. After reading JSON I want to unregister this module. Because my ObjectMapper is static and I don't want to use this module in any other places.
SimpleModule module = new…

Krishna Gollapudi
- 1,609
- 16
- 13
3
votes
2 answers
Jackson: add suffix according to a field type
Here my POJO:
public class AutorDenormalized {
private String id;
private Long unitatId;
private String grupId;
private String descripcio;
public AutorDenormalized() {
}
// getters $ setters
}
I'd like to serialise…

Jordi
- 20,868
- 39
- 149
- 333
3
votes
2 answers
Jackson: how do I do validation after deserialization?
I'm using Jackson with Kotlin to serialize and deserialize a variety of Kotlin data classes.
My data classes are quite simple objects which can easily be serialized and deserialized using the standard Jackson ObjectMapper, except that I want to…

Dan Lenski
- 76,929
- 13
- 76
- 124
3
votes
2 answers
Deserialize json string to object with properties which are strings in jackson
I have a json string which looks like:
{"a":5, "b":"asd", "c":"{\"d\":3}"}
This can be deserialized to an object like:
class A {
int a; // --> 5
String b; // --> 'asd'
String c; // --> '{"d":3}'
}
but i want it to be deserialized as:
class…

falcon
- 1,332
- 20
- 39
3
votes
1 answer
Jackson Kotlin - Deserialize JsonNode
Problem
I have JSON content in the form of a string, which I first want to traverse programmatically with Jackson. Then, when I have the node of interest, I want to deserialize it.
What I have tried
I have successfully deserialized strings using…

Devabc
- 4,782
- 5
- 27
- 40