HTTP Post Bad Request 400

Hi all, I’ve created a simple bpmn file which has a single task to send a http post message to MS Team channel. I’m using a task listener with the event type ‘Complete’. However, when I execute the flow the I receive an error of bad request with the status code 400.

I’ve tested the same code on a separate java console application and it works there just fine. But the same code doesn’t seem to work on camunda engine. Not sure where I did wrong.

Here’s the code of me calling the HTTP Post method:

 public static void POSTCall(String url, String authorization, String body) throws IOException {
 
    try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
        HttpPost httpPost = new HttpPost(url);
        //httpPost.setHeader("Accept", "application/json");
        httpPost.setHeader("Content-type", "application/json");
        httpPost.setHeader("Authorization", authorization);


        StringEntity stringEntity = new StringEntity(body);
        httpPost.setEntity(stringEntity);

        System.out.println("Executing request " + httpPost.getRequestLine());


        HttpResponse response = httpclient.execute(httpPost);
        System.out.println(response.getStatusLine().getReasonPhrase());
        System.out.println("Status Code: " + response.getStatusLine().getStatusCode());
        System.out.println("----------------------------------------");

    }
}

and in the pom.xml file I’m using the following dependency:

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.5</version>
</dependency>

image

@hello.aliasad can you provide the stacktrace?

Where can I get the stacktrace? I’m new to this technology. Would appreciate a help. Thank you.

camunda service server/console log.

Thanks for your reply. I’ve used project template that I’ve downloaded from http://start.camunda.com/ I’m running the application in intellij. I’ve checked the solution file, there I couldn’t find any log file. See the following image for your kind reference. Please advice where is location of log file for this project? Thank you

You can view the logs in Console also