question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot send process cloud event with OffsetDateTime fields

See original GitHub issue

Describe the bug Since 1.12.0.Final my process that’s using an object with OffsetDateTime fields as process variable fails to generate kafka cloud event, representing new task creation.

Expected behavior Process should generate new task and send proper cloud event to kafka topic.

Actual behavior There’s an exception thrown: Error while publishing event to topic kogito-processinstances-events for event org.kie.kogito.services.event.ProcessInstanceDataEvent@62564738: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.OffsetDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: org.kie.kogito.services.event.ProcessInstanceDataEvent["data"]->org.kie.kogito.services.event.impl.ProcessInstanceEventBody["variables"]->java.util.Collections$UnmodifiableMap["executionDates"]->com.orange.swing.microservices.process.TaskDates["startDate"])

Adding jackson-datatype-jsr310 nor quarkus-jackson doesn’t help. Problem doesn’t exist in 1.11.3.Final.

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific). https://github.com/jgrabowski/quarkus-bugs

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. launch kafka on 9092 port (e.g. docker run --rm -p 2181:2181 -p 9092:9092 -e ADVERTISED_HOST=172.17.0.1 -e NUM_PARTITIONS=1 --name kafka johnnypark/kafka-zookeeper)
  2. mvn clean compile quarkus:dev
  3. curl -X POST "http://localhost:8082/DateProblem" -H "accept: */*" -H "Content-Type: application/json" -d "{\"testDate\":\"2021-03-04T16:55:46.453Z\"}"

Configuration In attached project

Environment (please complete the following information): OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jgrabowskicommented, Mar 5, 2021

The problem you have is that Jackson started to not register additional modules automatically in Jackson 2.12. So modules need to be registered explicitly.

I’ve tried to register JavaTimeModule via ObjectMapperCustomizer but it doesn’t seem to work.

0reactions
mkoubacommented, Nov 29, 2022

Shall we move this issue to https://github.com/kiegroup/kogito-runtimes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Postgres] Accept LocalDateTime (and similar types without a ...
This is started as an issue for Quarkus. The problem is that when passing a LocalDateTime (or some similar type without a timezone)...
Read more >
OffsetDateTime - Android Developers
OffsetDateTime is an immutable representation of a date-time with an offset. This class stores all date and time fields, to a precision of...
Read more >
Startup error in Spring Cloud Stream after upgrading to Spring ...
I just upgraded a Spring Boot application that uses Spring Cloud Stream Kafka ... toEpochMilli()) .build() logger.info("Sending event {}", event) while ...
Read more >
Handling Timezones in a Spring Boot Application - Reflectoring
LocalDate is an immutable date object that does not store time or time zone information. However, we can pass the java.time.ZoneId object to...
Read more >
Processes - Known Issues for Oracle Integration
After signing out and the login page displays, users can click the back button and resume tasks. Can't change server information if configured...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found