UnrecognizedPropertyException when correlating messages to c8run

Hi,

Trying to test out Camunda 8 using c8run locally. I’m running camunda8-run-8.6.5 and have a java client application with spring-boot-starter-camunda-sdk 8.6.5 running a few jobs. Simple job execution works fine, but when trying to use the ZeebeClient autowired into the job worker class, I’m running into an issue:
newCorrelateMessageCommand and newProcessInstanceQuery are erroring due to the response classing not containing the “message” field:

io.camunda.zeebe.client.api.command.ClientException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "message" (class io.camunda.zeebe.client.protocol.rest.ProcessInstanceSearchQueryResponse), not marked as ignorable (2 known properties: "items", "page"])'''

This happens when just running this:

zeebeClient.newProcessInstanceQuery().send().join();

Similar issue when running:

zeebeClient.newCorrelateMessageCommand()
				.messageName("message_name")
				.correlationKey(processId)
				.send().join();

Publishing messages works, have not tried other methods yet since this issue has been bothering me. Any idea why this happens? Anything I’m doing wrong/unsupported? Can provide more details if needed.

Thanks.

Hi @fredrikw.

It seems like your ObjectMapper is somehow misconfigured.
In the spring-boot-starter-camunda-sdk the ObjectMapper is configured to not fail on unknown properties:

  public SdkObjectMapper(final ObjectMapper objectMapper) {
    this.objectMapper = objectMapper;
    this.objectMapper
        .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
        .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
        .setSerializationInclusion(JsonInclude.Include.NON_NULL);
  }

Makes a little more sense, but strange that it happens.
I shouldn’t have any code that creates a new or reconfigures the object mapper now. Its just 2 classes, a main class for starting Spring with a PostConstruct method for starting processes and a worker class which tries to correlate messages.
My pom only contains spring-boot-starter and spring-boot-starter-camunda-sdk.

But its probably an issue on my side then. I’ll look further into what beans are created when I get time.
Thanks for the reply.

Actually I just remembered that I also had problems with unknown properties in the past and now saw that for the HttpClient connection it uses another ObjectMapper, that is directly created in the HttpClientFactory.
And this one is not configured the same way.

Okay. Did some debugging and in my case the returned JSON just contains the message field.
It’s actually a message explaining why the call did not succeed.
In my case it was:
Full authentication is required for this call.

Don’t know why this doesn’t lead to an exception with that cause. Probably incorrectly returned with status code 200.

So I guess the same is true in your case. Find out what is written in the message to know what is incorrectly configured.

Thanks for the update, saved me some debugging.
I’ll check what the return is and add authentication if needed. Has this been reported as a bug? Returning a 200 in an error scenario with no handling is not very good :slightly_smiling_face:

I get the same error, but the text of mine is that a timestamp field is not recognised. Looking through the code and can see multiple locations where an ObjectMapper is created without configuration. I even went to 8.6.5 of everything and get the same error:

Request processing failed: io.camunda.zeebe.client.api.command.ClientException: io.camunda.zeebe.client.api.command.ClientException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timestamp" (class io.camunda.zeebe.client.protocol.rest.MessageCorrelationResponse), not marked as ignorable (3 known properties: "messageKey", "processInstanceKey", "tenantId"])
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.camunda.zeebe.client.protocol.rest.MessageCorrelationResponse["timestamp"])] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timestamp" (class io.camunda.zeebe.client.protocol.rest.MessageCorrelationResponse), not marked as ignorable (3 known properties: "messageKey", "processInstanceKey", "tenantId"])
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.camunda.zeebe.client.protocol.rest.MessageCorrelationResponse["timestamp"])