jackson Questions
4
I am getting this error for this class while deserializing the data, any input what I am doing wrong here:
Cannot construct instance of `Test` (no Creators, like default constructor, exist): canno...
2
Solved
I'd love to use this:
@Getter
@ToString
@RequiredArgsConstructor(onConstructor_ = {@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)})
private static class RestErrorObject {
private final Stri...
5
I am trying to implement a JsonView to selectively serialize fields from an entity but the json that is serialized has empty objects with no fields. Below is my code:
ViewClass:
public class Audi...
4
Solved
I'm playing around with Spring Boot 2.0.0M2, trying to create a CLI application, not a web one. My problem is that even including
compile 'org.springframework.boot:spring-boot-starter'
compile ...
Cheeky asked 28/6, 2017 at 16:14
3
The new Spring Boot 3.x upgrade (which also means an upgrade of Java to Java 17) has changed the namespaces from "javax" to "jakarta".
I am getting an exception when I run my ap...
Imbrication asked 11/12, 2023 at 11:42
3
I have this tree of objects
A
B extends A
C extends B
D extends B
E extends C
F extends A and has one reference to A
A has the following annotation
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS,i...
Sculpt asked 5/4, 2013 at 12:27
5
Solved
I have the following declaration in my object:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
private ZonedDateTime start;
And when I parse timestamps like ...
Maestricht asked 8/12, 2016 at 10:32
1
Solved
In my sample application I have a simple @RestController controller:
package app.springtest.api.book;
import app.springtest.service.BookService;
import lombok.RequiredArgsConstructor;
import lomb...
Onagraceous asked 10/5, 2019 at 13:22
3
Solved
I've a POJO with Jackson annotations
public class Sample{
private String property1;
@JsonIgnore
private String property2;
//...setters getters
}
So, when Jackson library is used for au...
3
Solved
In Spring 3.3 I have an entity which is mapped to a database table. In this entity class I have all properies annotated with @JsonProperty, for instance @JsonProperty("ID").
Stepping into the cont...
10
I'm trying to make a method, which uses the Json data with jackson library to have a list of objects.
If I run my code, I get the error:
java.lang.reflect.InaccessibleObjectException: Unable to mak...
2
9
Solved
kotlin 1.2.10
jackson-module-kotlin:2.9.0
I have the following data class in kotlin:
data class CurrencyInfo(
@JsonProperty("currency_info") var currencyInfo: CurrencyInfoItem?
)
@JsonInclude(J...
Chinch asked 26/12, 2017 at 18:8
14
Solved
JsonProperty isn't overriding the default name jackson gets from the getter. If I serialize the class below with ObjectMapper and jackson I get
{"hi":"hello"}
As you can see the JsonProperty ann...
Unwept asked 29/9, 2015 at 11:45
13
Solved
3
I have been reading a lot about Apache Avro these days and I am more inclined towards using it instead of using JSON. Currently, what we are doing is, we are serializing the JSON document using Jac...
2
Solved
My app uses Jackson. I got minimized builds mostly working with this configuration:
# don't obfuscate Jackson classes
-keep class com.fasterxml.** { *; }
# don't strip runtime annotations
-keepat...
2
I am upgrading to Jackson 2. I have many custom serializers extending SerializerBase (org.codehaus.jackson.map.ser.std.SerializerBase). What's the new equivalent class in Jackson 2
3
Solved
I have added the JS310 dependency to Maven and refreshed the dependencies:
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr3...
9
Solved
I am trying to retrieve JSON data from a URL but get the following error:
Illegal character ((CTRL-CHAR, code 31)):
only regular white space (\r, \n,\t) is allowed between tokens
My code:
final...
Disappearance asked 6/3, 2017 at 9:9
5
Solved
Below is a stacktrace I get when my rest service tries to fetch a large data set (database and tomcat are on my local machine, so everything is local). It works on smaller ones, but in some cases u...
2
Solved
I have already included following line to keep all files inside the package.
-keep class com.fasterxml.** { *; }
I am getting following exception.
Caused by: java.lang.IllegalArgumentExceptio...
4
I'm using springBoot to develop a REST APi. And i have a LocalDate field "firstDate" in the response model of a GET endpoint. But this LocalDate is serializable as an array in the respons...
Parthenopaeus asked 14/3, 2021 at 12:24
3
I'm having a problem in which jackson is deserializing numeric values into arbitrary types which I cannot predict. For example, if someone passes the value "14", jackson will instantiate it as an I...
Walburga asked 24/10, 2016 at 8:41
4
Solved
I'm using the Jackson library.
I want to ignore a specific field when serializing/deserializing, so for example:
public static class Foo {
public String foo = "a";
public String bar = "b";
@J...
Ablaut asked 3/1, 2012 at 20:45
1 Next >
© 2022 - 2024 — McMap. All rights reserved.