Questions tagged [jackson2]

Use this tag only for questions specifically related to version 2 of the Jackson library

Jackson version 2 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.

464 questions
2
votes
0 answers

WildFly Jackson 2

My project configuration My Jboss-Deployment-Structure.xml
LeshaRB
  • 1,345
  • 2
  • 23
  • 44
2
votes
1 answer

Unwrap only some properties with Jackson

Assuming I have this objects: class Person { String name; Household getHousehold(); } class Household { Set
getAddresses(); String householdId; } which would normally be serialized as follows { "name": "XXX", "household":…
Quentin
  • 481
  • 6
  • 13
2
votes
1 answer

Jackson configuration to consume list of records in rabbitmq

I am using spring boot amqp in which I will be consuming a list of Employee objects from a queue. My listener method looks like this: @RabbitListener(queues = "emp_queue") public void processAndPortEmployeeData(List empList) { …
vin4yak
  • 35
  • 8
2
votes
1 answer

java.lang.NoSuchMethodError Using Jackson Core Streaming API

I am using Jackson Core version 2.8.3, but why do I keep getting java.lang.NoSuchMethodError? I am not using any other Jackson's modules, just the core (streaming) API Object[] result = imageGenerator.generate(lowerBound, upperBound,…
Trash Can
  • 6,608
  • 5
  • 24
  • 38
2
votes
2 answers

Jackson - Using custom PrettyPrinter with custom JsonSerializer

I am using Jackson v2.8.2 to serialise JSON to a file. I have created a custom serializer and implemented the serialize method to customise the JSON output as required. I am invoking the serializer as follows: // myClass is the object I want to…
ksl
  • 4,519
  • 11
  • 65
  • 106
2
votes
2 answers

Extract specific node of JSON response in RESTEasy Client

I'm retrieving a JSON string from an API using a RESTEasy client. The JSON payload looks something like this: { "foo1" : "", "foo2" : "", "_bar" : { "items" : [ { "id" : 1 , "name" : "foo", "foo" : "bar" }, { "id" : 2 , "name"…
Martin Peter
  • 3,565
  • 2
  • 23
  • 26
2
votes
2 answers

Spring Redis JSON serializer embeds referenced field

I have a class which has many simple attributes (type is int,String,...). It also has an attribute which is an instance of another class of mine. Now I want to send the object via a Redis pub/sub channel. To do this I serialize it with the…
Frozn
  • 539
  • 1
  • 8
  • 17
2
votes
1 answer

Spring Data REST - JsonGenerationException: Can not write a number, expecting field name

I'm running into an issue with a Spring Data REST application using the Spring Boot starter. I have a number of entities defined with various relationships. I'm able to retrieve them by key (generally), but I'm having problems with some collections…
1
vote
1 answer

Jackson XML to JSON, ignore attributes

I have XML like this: .... 0001-01-01T00:00:00
djb
  • 1,635
  • 3
  • 26
  • 49
1
vote
2 answers

json variable name starts with number

example json { "11var":"value1", "11var2":"val2", "11var3":"val3", "11var4":"val444", "11var5":"val5", ..... } how to convert this to a pojo in latest spring boot and jackson setup? PS: I know we can do @JsonProperty("11var") and so on for all…
ozkanpakdil
  • 3,199
  • 31
  • 48
1
vote
1 answer

SpringBoot/Jackson 2.13.x - outputting standalone="yes" in XML Header

I'm configuring my ObjectMapper/XmlMessageConverter in Spring Boot with the following Beans: @Bean public Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() { final AnnotationIntrospector introspector = new…
Chris Spiking
  • 196
  • 3
  • 16
1
vote
0 answers

How to include large data into JsonGenerator as rawData while creating wrapper JSON?

I have a Java application method which accepts InputStream as its input parameter. This input parameter includes the large customer data in JSON format. I have to create the wrapper elements to this JSON to match the standard. The user provided JSON…
SUPERMAN
  • 111
  • 3
1
vote
1 answer

Jackson How to add additional properties during searlization without making changes to default POJO?

I am using Jackson-ObjectMapper to create the JSON data according to my POJO. I would like to add some additional properties to my JSON without modifying the POJO. Since the POJO has been added as a dependency in my project I cannot modify it but I…
BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
1
vote
0 answers

@ConstructorProperties in jackson2 does not work when deserializing from array elements

I want to use @ConstructorProperties instead of @JsonCreator but it looks like it doesn't work in some scenarios. @ConstructorProperties in jackson2 does not work when deserializing from array elements. Is there any way for both method1() and…
kurt26
  • 21
  • 5
1
vote
0 answers

Flink kafka getting serialization issue for timestamp values

I have a flink Row with TypeInformation of Object class for all columns, I'm getting below error for timestamp columns while serializing Row to kafka. Flink version: 1.14.0 Caused by: java.lang.IllegalArgumentException: Java 8 date/time type…