Questions tagged [jackson-modules]
177 questions
1
vote
1 answer
In Kotlin, why Jackson fails unmarshalling non-annotated object in some cases and not in others
I'm using Kotlin with Jongo to access MongoDB. Jongo uses Jackson to serialize/deserialize objects in order to save and read them from MongoDB. I use Jackson-Kotlin module to help serialize Kotlin data classes using constructors.
Here's an example…

Krešimir Nesek
- 5,302
- 4
- 29
- 56
1
vote
1 answer
Jackson ObjectMapper wraps every element with square brackets (Even single values)
I have two Map objects where I merge them into Guava's Multimap. After merging I am trying to serialize the final map by jackson ObjectMapper with GuavaModule (otherwise it doesn't serialize properly). However, the issue is every value of a key is…

quartaela
- 2,579
- 16
- 63
- 99
1
vote
1 answer
How to configure RESTEasy to use the Jackson afterburner module
With large payloads, we are seeing that when JSON is converted to POJO, it is taking lot of time. Internally it uses Jackson. Was wondering if there is a way that we can configure RESTEasy to use Afterburner module which seems to better the…

Harry
- 528
- 1
- 5
- 21
1
vote
2 answers
Jackson - Extract Data without Brackets, Commas, and =?
I don't know a ton about Jackson, I'm just using it because I needed to share data from Python to Java. Anyway my code is pretty simple
ObjectMapper mapper = new ObjectMapper();
Map data = mapper.readValue(new File(FileName),…

jonbon
- 1,142
- 3
- 12
- 37
1
vote
1 answer
deserializing CDATA with JacksonXML - UnrecognizedPropertyException
I am using jackson libraries (2.5.2) and trying to deserialize some XML that actually has CDATA section.
It seems that Jackson 2.5 added support for CDATA.
Here is my class that has the CDATA:
public class Certificate…

Greg Hill
- 2,148
- 2
- 23
- 27
1
vote
0 answers
Unrecognized field "User" (Class com.test.webservice.bean.User), not marked as ignorable
Hello I am trying to convert the below json object through the jersey service,
{
"User": {
"username": "newusername",
"password": "newpassword",
"email": "test.test@test.com",
"address": "test",
…

Darshan
- 117
- 7
1
vote
1 answer
jackson 2.4 looking for old class when deserialising
i am developing a restful service with tomcat 7 and jdk 1.6. for json handling i am using jackson 2.4.2 and it works fine except when i try and deserialise an object (that it has no trouble serialising).
the error…

Brett Schneider
- 3,993
- 2
- 16
- 33
1
vote
0 answers
Json validation schema generation based on hibernate validator annotations
I have a POJO annotated with hibernate validator annotations:
public class UserDto {
@Length(min = 2, max = 5)
@NotEmpty
private String name;
@Length(min = 8)
@NotEmpty
private String password;
//getters and…

vlashel
- 345
- 2
- 15
1
vote
2 answers
jackson-module-scala: how to read subtype?
With this jackson-module-scala wrapper
object Json {
private val ma = new ObjectMapper with ScalaObjectMapper
ma.registerModule(DefaultScalaModule)
ma.setSerializationInclusion(Include.NON_NULL)
def jRead[T: Manifest](value: String): T =…

Andrew Gaydenko
- 267
- 2
- 11
1
vote
1 answer
JAXB Class - XML not getting created as expected
I am using fasterxml-jaxb(2.3) module to generate XML but it seems its not reading Xmlns annotation while creating XML. I have the prefix defined in my package-info as below
@javax.xml.bind.annotation.XmlNs(prefix = "bla"....
Jackson does not…

user1428716
- 2,078
- 2
- 18
- 37
1
vote
1 answer
How to resolve foreign keys from JSON object with Jackson
In a book library system with Dropwizard (with Jackson and Hibernate), there are the following classes:
@Entity
@Table(name="author")
public class Author {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
…

Explicat
- 1,075
- 5
- 16
- 40
1
vote
1 answer
How do I get the JodaModule to do withZoneUTC() date format through Jackson?
So I've got my Jackson and Joda support all set up...
ext.jackson = [version: '2.3.2']
...
compile "com.fasterxml.jackson.core:jackson-core:${jackson.version}"
compile "com.fasterxml.jackson.core:jackson-databind:${jackson.version}"
compile…

Bob Kuhar
- 10,838
- 11
- 62
- 115
1
vote
1 answer
Jackson API - Customize StdKeySerialize to add an attribute
We have a HashMap with values as per below.
Map hm = new HashMap();
map.put("type:1234", "value");
The general jackson-databind api would serialize this into
value
I want it to serialize as…

Sudheer
- 11
- 1
1
vote
1 answer
NoSuchMessageException when using a custom message converter along formatters
I'm using Spring 3.2 M1 and Hibernate 3.
I was working with formatters to format POJOs (which happen to be Hibernate mapping entities) to their string representation. This was very convenient as it worked the other way around allowing me to bind…

Mina
- 196
- 10
0
votes
2 answers
JSONObject inside an object is getting serialized to some other form as compared to a map
Why serialization is not working as expected for the JSONObject inside an Object ?
class Random {
String name;
JSONObject json;
}
JSONObject json= new JSONObject();
json.put("key", "value");
Random random = new Random("name", json);
new…

tusharRawat
- 719
- 10
- 24