Could not parse external task

Hi, I have problem to simply fetchAndLock external task via externalTaskClient. When I subscribe to an existing topic where I have one task waiting, I receive

> Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
>  at [Source: (org.apache.hc.core5.http.io.EofSensorInputStream); line: 1, column: 2]

When I debug camunda internal classes I found response contains:
404 Not Found HTTP/1.1

I used example code from git

ExternalTaskClient client = ExternalTaskClient.create()
            .baseUrl("http://localhost:8080/engine-rest")
            .asyncResponseTimeout(1000)
            .customizeHttpClient(httpClientBuilder -> {
                httpClientBuilder.setDefaultRequestConfig(RequestConfig.custom()
                    .setResponseTimeout(Timeout.ofSeconds(15))
                    .build());
            })
            .build();

        // subscribe to the topic
        client.subscribe("my-job")
            .handler((externalTask, externalTaskService) -> {

                System.out.println("The External Task " + externalTask.getId() +
                    " has been completed!");

            }).open();

When I tried to do POST via postman I succeeded:

POST http://localhost:8080/engine-rest/external-task/fetchAndLock
200
12 ms
POST /engine-rest/external-task/fetchAndLock HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 90d59a92-416e-4bba-a2e5-cb9092991c2a
Host: localhost:8080
Content-Length: 140
 
{
"maxTasks": "10",
"topics": [
{
"topicName": "my-job",
"lockDuration": "10000"
}
]
}
 
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 744
Date: Wed, 28 Aug 2024 08:06:38 GMT
 
[{"activityId":"Activity_0uha6vd","activityInstanceId":"Activity_0uha6vd:bd865718-646f-11ef-87ee-6e671798553f","errorMessage":null,"errorDetails":null,"executionId":"bd865717-646f-11ef-87ee-6e671798553f","id":"bd86a539-646f-11ef-87ee-6e671798553f","lockExpirationTime":"2024-08-28T10:06:48.933+0200","createTime":"2024-08-27T14:27:35.563+0200","processDefinitionId":"Process_cam7_quarkus_intg:2:bbdb6634-646f-11ef-87ee-6e671798553f","processDefinitionKey":"Process_cam7_quarkus_intg","processDefinitionVersionTag":null,"processInstanceId":"bd8608f5-646f-11ef-87ee-6e671798553f","retries":null,"suspended":false,"workerId":"quarkusino","topicName":"my-job","tenantId":null,"variables":{},"priority":0,"businessKey":"0","extensionProperties":{}}]

I use clean maven project containing just these dependencies:

<dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-external-task-client</artifactId>
      <version>7.21.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>4.0.5</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.9</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>2.0.9</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

Camunda runs as standalone app version 7.21.0 started via start.sh. Everything runs on Macbook M2 with jakarta 17 Temurin. Any ideas what could help?

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