Jackson cant serialize Camunda Objects

I am working on a Camunda application using Jackson for JSON serialization. Recently I have been experiencing issues with serializing Camunda objects.

Details: Camunda Version: 7.21.0 Jackson Version: 2.16.0 Spring Framework Version: 5.3.32

Error description: Jackson serialization fails and I get the following error messages in my REST-Api:

org.springframework.http.converter.HttpMessageConversionException: type definition error: [simple type, class org.camunda.bpm.engine.impl.core.model.Properties]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.camunda.bpm.engine.impl.core.model. Properties and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java. util.ArrayList[0]->en._______.api.core.rest.types.ReturnPlain[“content”]->java.util.ArrayList[0]->org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity[“properties”])

and

org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Cannot invoke “org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.isExecutionTreePrefetchEnabled()” because the return value of “org. camunda.bpm.engine.impl.context.Context.getProcessEngineConfiguration()” is null; nested exception is com.fasterxml.jackson.databind.JsonMappingException: The call of ”org.camunda.bpm. engine.impl.cfg.ProcessEngineConfigurationImpl.isExecutionTreePrefetchEnabled()” is not possible because the return value of ‘org.camunda.bpm.engine.impl.context.Context. getProcessEngineConfiguration()’ is null (via the reference chain: java. util.ArrayList[0]->en.________.api.core.rest.types.ReturnPlain[“content”]->java.util.ArrayList[0]->org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity[“businessKey”])

These problems have recently started to occur. Previously it worked perfectly.

Note: Is it possible that there is a problem when Jackson and Gson are used in the same project? I don’t really see any problems in the implementation, but Gson was introduced around the time the problems occurred. Maybe a coincidence, maybe not. Gson version: 2.9.0

I’ve already tried adjusting the Jackson mapper configuration (e.g., SerializationFeature.FAIL_ON_EMPTY_BEANS, FAIL_ON_UNKNOWN_PROPERTIES or setVisibility), but without success leading to a self-referencing loop.

What I’ve Tried: Changed the Jackson configuration. Reviewed the code for potential issues in the data models. Ensured that all required fields are accessible for serialization. Tried older versions.

So my question: Does anybody know, why Jackson cant serialize some Camunda-Objects?

Hi @langosSimp

These problems have recently started to occur. Previously it worked perfectly.

What changes were made before it started to occur?

Regards,
Alex

Hi @Alex_Voloshyn

Maybe my wording wasn´t ideal. I dont really know when the error started to occur. The error was documented on 27.08.24. No big related changes beforehand. The camunda version was updated on 17.07.24 from 7.20.0 to 7.21.0 tho. Is there a possibility that it is related to this update? Maybe some config conflicts?

Addition: To determine when the error first occurred, I looked at the historical git branches. The problem: I can go back to 03.08.2023 and the error still occurs. BUT: It is unrealistic that the error has existed for so long.

Can you share the full dependencies list before and after the update from 7.20.0 to 7.21.0?
It looks like a dependency issue to me.
Regards,
Alex

currentDeps.yaml (42.6 KB)
oldDeps.yaml (58.8 KB)

The two requested dependencies lists.
Thank you for looking into this!

Best regards

Since you already mentioned it. Did you try to exclude it from your project dependencies for testing purposes?