camel-karavan icon indicating copy to clipboard operation
camel-karavan copied to clipboard

Issue format Datetime java

Open huuhoait opened this issue 1 year ago • 2 comments

Hi all , there is an issue with jackson format date. I take simple route with yaml dsl:

- route:
    id: route-692d
    from:
      uri: kamelet:mysql-source
      id: from-4e99
      parameters:
        serverName: localhost
        databaseName: simple_admin
        username: root
        password: '123456'
        serverPort: '3306'
        query: select * from users
        delay: 5000
      steps:
        - log:
            message: 'sqlsourcce: ${body} \n'
            logName: out sql source
            id: log-5a7f

When this app run, i got error about ; "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 (through reference chain: org.springframework.util.LinkedCaseInsensitiveMap["created_at"])"

I added dependency: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 and config env:camel.dataformat.jackson.module-class-names=com.fasterxml.jackson.datatype.jsr310.JavaTimeModule but i can not resolved above issue

huuhoait avatar Oct 25 '23 14:10 huuhoait

This is not really a karavan issue but the kamelet uses jackson and there is some datetime "crap" to deal with.

What JDK version and Camel version do you use.

davsclaus avatar Oct 26 '23 10:10 davsclaus

I used:

OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode) Camel 4.0

huuhoait avatar Oct 30 '23 06:10 huuhoait