Hello,

you have to register the module.

For example:

final JacksonDataFormat df = new JacksonDataFormat(MyPojo.class);

df.setObjectMapper(new ObjectMapper().registerModule(new
JavaTimeModule()));

Regards


On Thu, 2022-05-12 at 10:19 +0300, Vyacheslav Boyko wrote:
> Hello!
> 
> How to get managed with such problem?
> 
> I need to unmarshall incoming from Kafka data into POJO having one
> field 
> of LocalDateTime type.
> 
> I have the route:
> 
>          from(parametersProvider.getEventsListeningEndpoint())
>                  .unmarshal().json(EventDto.class)
> 
> And it produces the exception:
> 
> com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8
> date/time type `java.time.LocalDateTime` not supported by default:
> add 
> Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to 
> enable handling
> 
> I have these dependencies
> 
>      implementation group: 'com.fasterxml.jackson.datatype', name: 
> 'jackson-datatype-jsr310', version: '2.12.4'
> 
>      implementation group: 'org.apache.camel.springboot', name: 
> 'camel-jackson-starter', version: '3.15.0'
> 
>      implementation group: 'org.apache.camel', name: 'camel-jackson',
> version: '3.15.0'
>      implementation group: 'org.apache.camel', name: 'camel-
> jacksonxml', 
> version: '3.15.0'
> 
> but they seem don't work in this case.
> 
> How to deal with it?
> 

Reply via email to