I have a REST endpoint in a container (Payara 4)
I have added the dependency to the pom.xml for the joda serialization extension.
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.10.3</version>
</dependency>
But I get the items serialized incorrectly.
"dt":{"chronology":{},"millis":1499896800000}
I know I need to use jackson-databind-joda, but I am not sure how to register it correctly in PAYARA. There are examples for Spring Boot, but not for the older application servers?
@Path("bom")
@Stateless
public class ProductionMaterialRestEndpoint {
@POST
@Path("kw/compare/{year}/{week}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ResultContainingDateTime compare(
@PathParam("year") int year,
@PathParam("week") int week) throws IOException, ExecutionException {
...
}
}
public class ResultContainingDataTime {
private org.joda.time.DateTime dt;
}
how do I register the joda serializer module with the serializer built into PAYARA /GLASSFISH