I learned from this forum that this can be solved adding the SPIN plugin and it’s also highly advised to change the serialization data format from JAVA to JSON.
I applied these 2 changes and the SPIN plugin seems to be detected successfully:
(The reason behind it is some copying of some classes to a spinjar directory, which messed up our classpath.)
Then we implemented org.camunda.spin.spi.DataFormatConfigurer`. As we use SpringBoot this looks as follows:
@Component
public class CamundaJacksonFormatConfigurator implements DataFormatConfigurator<JacksonJsonDataFormat> {
@Override
public Class<JacksonJsonDataFormat> getDataFormatClass() {
return JacksonJsonDataFormat.class;
}
@Override
public void configure(JacksonJsonDataFormat dataFormat) {
final ObjectMapper objectMapper = dataFormat.getObjectMapper();
final JavaTimeModule javaTimeModule = new JavaTimeModule();
objectMapper.registerModule(javaTimeModule);
}
}
I am not a 100% sure, if that is valid for current versions, possibly by now it works out of the box, but we still have this code in production with Camunda 7.16.
I tried that but then ended up in a dependency hell and after spending some time we realized that Camunda 7.20 supports Java8 Time types out of the box, so we are just upgrading version.
Thanks.
Did your DTO have an empty constructor @ciccio ? Because deserialization errors can occur due to the lack of an empty constructor, since Jackson uses reflection when doing this.