This error occurs when I run the code ChargeCardWorker.class
org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02001 Request 'POST HTTP/1.1' returned error: status code '404' - message: status code: 404, reason phrase: <!doctype html><html lang='zh'><title>HTTP Status 404</title><h3>Apache Tomcat/8.5.50</h3></html>
at org.camunda.bpm.client.impl.EngineClientLogger.exceptionWhileReceivingResponse(EngineClientLogger.java:30)
at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:97)
at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74)
at org.camunda.bpm.client.impl.EngineClient.fetchAndLock(EngineClient.java:78)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.fetchAndLock(TopicSubscriptionManager.java:135)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:101)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.http.client.HttpResponseException: status code: 404, reason phrase: <!doctype html><html lang='zh'>HTTP Status 404<h3>Apache Tomcat/8.5.50</h3></body></html>
at org.camunda.bpm.client.impl.RequestExecutor$1.handleResponse(RequestExecutor.java:146)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:88)
... 6 more
I don't think I made a mistake by following the tutorial.How to solve this problem?
1 Answer
The 404 error indicates that the API cannot be reached under the URL the client is using.
Check if the baseUrl defined in your worker (~line 12) is matches the url under which the server is exposing the REST-API e.g.
baseUrl("")
Is the port correct? Is the REST API deployed? Validate this in your browser e.g. by accessing
Possible causes on the server-side:
- the server is not started
- Camunda is not deployed
- the deployment failed (check server log)
- the REST-API (spring boot starter) was not included in the deployment
Depending on which Camunda version and deployment model you are using the rest-api may be accessible under a different URL.
Older:
spring-boot -> /rest non-spring-boot -> /engine-rest
From 7.13 onward:
only /engine-rest
Also try