Wildfly 9 – How do I exclude Jackson

I just ran into this issue myself. After upgrading a library in my application, I received the following error on a request: Exception handling request to /path: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.hasToken(Lcom/fasterxml/jackson/core/JsonToken;) Here is how I solved it: I obviously had to exclude jackson-core-2.5.1 that wildfly-9 provides. I listed all modules that depend on ‘jackson-core’ with /opt/wildfly/modules# grep … Read more

Is there a jackson datatype module for JDK8 java.time?

As already mentioned, Jackson-Datatype-JSR310 provides support for Java 8 Time. Since Jackson 2.6.0 the “old” JSR310Module is deprecated. It is replaced by JavaTimeModule. Maven dependency is the same (you can find the current version in Maven Central): <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>2.6.0</version> </dependency> You have to register the module like this: ObjectMapper mapper = new ObjectMapper(); … Read more

serialize/deserialize java 8 java.time with Jackson JSON mapper

There’s no need to use custom serializers/deserializers here. Use jackson-modules-java8’s datetime module: Datatype module to make Jackson recognize Java 8 Date & Time API data types (JSR-310). This module adds support for quite a few classes: Duration Instant LocalDateTime LocalDate LocalTime MonthDay OffsetDateTime OffsetTime Period Year YearMonth ZonedDateTime ZoneId ZoneOffset