Error when starting a process from Postman

Hi,
I want to start a process from postman, rather than using UI of tasklist. I had done this before with Camunda Run, but now I am using Camunda Spring Boot and I encounter error 500!
The key of my process is “user” (it is actually a pool in a workflow with 3 pools), and the start event is just a simple “None” start event. I tried the following post requests in Postman:

http://localhost:8080/engine-rest/process-definition/key/user/start
http://localhost:8080/engine-rest/process-definition/key/user/submit-form

according to this blog, and this manual, at least one of them should have worked. But they both return 500, with the following response :

{
    "type": "NullPointerException",
    "message": null
}

Could anyone help me understand the problem?
Thanks in advance

Hello @NSh ,

try adding an empty json object to the body.

Did this solve your problem?

Jonathan

1 Like

Hi @jonathan.lukas,

Thanks a lot for your quick reply. Sorry I wasn’t here for a while.
Yes I tried it with an empty json and it works now :slight_smile:

Hello @NSh ,

that is great to hear. Ususally, there should be a filter in place that sets this empty body. For some reason, this is missing in your setup. Which version of Camunda do you use?

Jonathan

Hi @jonathan.lukas,
I am using version 7.17.0. I made the spring boot project using Camunda Automation Platform 7 Initializr.

@jonathan.lukas
This is the pom file of a sample Spring Boot project I just generated:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.example.workflow</groupId>
  <artifactId>my-project</artifactId>
  <version>1.0.0-SNAPSHOT</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.6.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>7.17.0</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine-plugin-spin</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-all</artifactId>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.6.4</version>
      </plugin>
    </plugins>
  </build>

</project>

Hello @NSh ,

actually, the filter works. The problem is that it is only sensitive if the Content-Type is application/json, regardless of the actual content. Postman emits the content-type header in case no content is there.

To make it work without the empty body, you can also add the Content-Type header manually.

Jonathan