0

I cannot serialize a date of type org.joda.time.DateTime with spring boot 1.3.1. I have included the following dependencies:

joda-time:joda-time

com.fasterxml.jackson.datatype:jackson-datatype-joda

What could be the problem?

Thanks

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
blacksword
  • 101
  • 1
  • 6
  • 2
    Welcome to stack overflow please read http://stackoverflow.com/help/how-to-ask and then improve your question. – M. Deinum Jan 08 '16 at 14:12

1 Answers1

0

I faced the same problem but it is not related to Spring Boot. It's got to do with the Jackson not recognizing the "DateTime" data type. I converted the datetime to a String before serialization.

However it is possible to directly serializing it by registering the Jackson module while initializing the ObjectMapper object. Check out How to serialize Joda DateTime with Jackson JSON processer?

Community
  • 1
  • 1
Srikanta
  • 1,145
  • 2
  • 12
  • 22