I have a small service based on Thorntail and Microprofile. It seems pretty simple - get the JSON in the POST request do some stuff, return the response. The issue though, in a POJO I have a LocalDateTime
field and there things go awry, here's the response I get
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct
instance of `java.time.LocalDateTime` (no Creators, like default construct,
exist): no String-argument constructor/factory method to deserialize from
String value ('2020-04-28T04:10:48.020Z')
at [Source: (io.undertow.servlet.spec.ServletInputStreamImpl); line: 1,
column: 496] (through reference chain:
com.ainq.pulse.audit.model.UserAuditEvent["timestamp"])
Why it uses Jackson instead of Jsonb provider ?
In the log I get following message (among others)
2020-04-28 10:19:37,235 WARN [org.jboss.as.jaxrs] (MSC service thread 1-6)
WFLYRS0018: Explicit usage of Jackson annotation in a JAX-RS deployment; the
system will disable JSON-B processing for the current deployment. Consider
setting the 'resteasy.preferJacksonOverJsonB' property to 'false' to restore
JSON-B.
Where do I set this resteasy.preferJacksonOverJsonB
propert ?
I have tried to set property in project-defaults.yml
, i have tried to supply as a -D
argument, nothing seems to work and I still get this message and I still have issues with (de)serializing.
What is the way to fix it ? I looked at the documentation, examples and even source code, still have to idea what would work.
UPDATE:
Relevant part from dependency:tree
[INFO] +- io.thorntail:microprofile:jar:2.6.0.Final:compile
[INFO] | +- io.thorntail:jaxrs:jar:2.6.0.Final:compile
[INFO] | | +- io.thorntail:jaxrs-cdi:jar:2.6.0.Final:compile
[INFO] | | +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:jar:2.0.0.Final:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-core:jar:2.9.10:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.10:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.10.1:compile
[INFO] | | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.10:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.10:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.10:compile