Cannot construct instance of java.time.Instant when using External Task Client

Hi everyone,

I’m getting this error when using the External Task Client in my Spring Boot worker:

Cannot construct instance of `java.time.Instant` 
(no Creators, like default construct, exist)

It happens when I do:

Map<String, Object> in = externalTask.getAllVariables();

ResultDTO result =
    calculationService.calculate(
        in,
        externalTask.getActivityId(),
        externalTask.getProcessDefinitionId(),
        externalTask.getId(),
        externalTask.getTopicName(),
        externalTask.getProcessInstanceId(),
        externalTask.getTenantId()
    );

Notes

  • The same code works fine when running as a normal JavaDelegate inside the Camunda engine.

  • I already added Spin to the embedded engine, so Instant is handled correctly there.

  • The error only appears when the variables are fetched via External Task Client.

How can I make the External Task Client handle Instant fields correctly?
Do I need to configure its Jackson ObjectMapper or Spin manually?

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.