SpringBoot Camunda 7.14 REST API doesn't works

I’m trying to porting a SpringBoot application from Camunda 7.8 to Camunda 7.14.
According to ‘Spring Boot Version Compatibility’ page

https://docs.camunda.org/manual/7.14/user-guide/spring-boot-integration/version-compatibility/

in my pom.xml file the Camunda 7.14 properties are:

<properties>
  <java.version>1.8</java.version>
  <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
  <camunda.version>7.14.0</camunda.version>
   <camunda.spring-boot.version>7.14.0</camunda.spring-boot.version>
  <spring-cloud.version>Hoxton.SR4</spring-cloud.version>
</properties>

and dependencies are:

<dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
        <version>${camundaSpringBoot.version}</version>
</dependency>
<dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
        <version>${camundaSpringBoot.version}</version>
</dependency>
<dependency>
        <groupId>org.camunda.bpm.extension</groupId>
        <artifactId>camunda-bpm-assert-scenario</artifactId>
        <version>0.2</version>
        <scope>test</scope>
</dependency>

Then according to Camunda ‘Update from 7.12 to 7.13’ page

https://docs.camunda.org/manual/7.14/update/minor/712-to-713/#changed-default-application-paths

the default application path is changed:

REST API

  • Old Application Path: /rest
  • New Application Path: /engine-rest

Webapp

  • Old Application Path: /
  • New Application Path: /camunda

The application works fine but when I try to use the REST API by curl commands doens’t work.
For instance the following command:

curl -X GET -H "Content-Type: application/json" http://192.168.25.203:8285/engine-rest/history/process-instance?finishedBefore=2020-11-01T09:45:00.000UTC

not works because the base path “/engine-rest” not exist. I retrieve a bad request:

{"timestamp":"2020-12-17T11:09:49.622+00:00","status":404,"error":"Not Found","message":"","path":"/engine-rest/history/process-instance"}

While, with the Camunda 7.8 version, the same command with the base path “/rest” works fine:

curl -X GET -H "Content-Type: application/json" http://192.168.25.203:8082/rest/history/process-instance?finishedBefore=2020-12-01T09:45:00.000UTC

I have also added the Spring Actuator and enabled the “mappings” endpont in order to discovery the camunda REST base path…but I doesn’t find it.
Could You please help me to fix the problem?

Thanks in advance,
Giuseppe

have you changed the application context path to a different name after the upgrade?

Something like below, In that case, you have to call rest API using http://192.168.25.203:8082/bpm/engine-rest

server:
  servlet:
    context-path: /bpm
1 Like

Share your complete pom.xml and application.yaml file ?

1 Like

Hi,

I haven’t changed the application context path.
This is the my Camunda configuration (application.properties file):

# ===============================
# = CAMUNDA DATASOURCE
# ===============================
camunda.bpm.datasource.type=postgres
camunda.bpm.datasource.schema-update=true
camunda.bpm.datasource.schema-name=camunda
app.camunda.bpm.datasource.driver-class-name=org.postgresql.Driver
app.camunda.bpm.datasource.url=jdbc:postgresql://localhost:5432/camunda_db
app.camunda.bpm.datasource.username=app
app.camunda.bpm.datasource.password=
app.camunda.bpm.datasource.platform=postgresql

app.camunda.bpm.datasource.hikari.minimumIdle=5
app.camunda.bpm.datasource.hikari.maximumPoolSize=20
app.camunda.bpm.datasource.hikari.idleTimeout=30000
app.camunda.bpm.datasource.hikari.poolName=CamundaJPAHikariCP
app.camunda.bpm.datasource.hikari.maxLifetime=2000000
app.camunda.bpm.datasource.hikari.connectionTimeout=30000
app.camunda.bpm.datasource.hikari.jdbc-url=jdbc:postgresql://localhost:5432/mmg_camunda_db
app.camunda.bpm.datasource.hikari.username=app
app.camunda.bpm.datasource.hikari.password=

# ===============================
# = CAMUNDA CONFIGURATION
# ===============================

spring.main.allow-bean-definition-overriding=true
camunda.bpm.auto-deployment-enabled=true
camunda.bpm.admin-user.id=kermit
camunda.bpm.admin-user.password=superSecret
camunda.bpm.admin-user.firstName=Kermit
camunda.bpm.filter.create=All tasks
# = CAMUNDA Job Execution settings
# defualt =3
camunda.bpm.job-execution.core-pool-size=200
# defualt =3
camunda.bpm.job-execution.max-jobs-per-acquisition=200
# default =10
camunda.bpm.job-execution.max-pool-size=600
# defualt =3
camunda.bpm.job-execution.queue-capacity=200


# CAMUNDA SETTINGS - START #
camunda.bpm.deployment-resource-pattern = classpath:bpmn/worklow/*.bpmn
# CAMUNDA SETTINGS - END #

and this is my pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.3.6.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.app</groupId>
	<artifactId>app-nc</artifactId>
	<version>REL_001.000.000-new-camunda</version>
	<name>app</name>
	<description>Project test camunda 7.14</description>

	<properties>
		<java.version>1.8</java.version>
		<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
		<camunda.version>7.14.0</camunda.version>
		 <camunda.spring-boot.version>7.14.0</camunda.spring-boot.version>
		<spring-cloud.version>Hoxton.SR4</spring-cloud.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.junit.vintage</groupId>
					<artifactId>junit-vintage-engine</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- spring-boot-autoconfigure -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-autoconfigure</artifactId>
		</dependency>
		
		<!-- SpringCloud Client Config -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-config</artifactId>
		</dependency>
		<dependency>
	      <groupId>org.springframework.cloud</groupId>
	      <artifactId>spring-cloud-config-client</artifactId>
	    </dependency>
	    <dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter</artifactId>
		</dependency>
       <!-- Configuration -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>		
		
		<!-- JPA -->		
       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
       </dependency>
       <!-- Postgresql -->		
	   <dependency>
 			<groupId>org.postgresql</groupId>
 			<artifactId>postgresql</artifactId>
 			<scope>runtime</scope>
 	   </dependency>
		
 	    <!-- Camunda Dependencies -->
        <dependency>
                <groupId>org.camunda.bpm.springboot</groupId>
                <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
                <version>${camundaSpringBoot.version}</version>
        </dependency>
        <dependency>
                <groupId>org.camunda.bpm.springboot</groupId>
                <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
                <version>${camundaSpringBoot.version}</version>
        </dependency>
        <dependency>
                <groupId>org.camunda.bpm.extension</groupId>
                <artifactId>camunda-bpm-assert-scenario</artifactId>
                <version>0.2</version>
                <scope>test</scope>
        </dependency>
        <!--dependency>
                <groupId>org.camunda.bpm.extension</groupId>
                <artifactId>camunda-bpm-assert</artifactId>
                <version>2.0-alpha1</version>
                <scope>test</scope>
        </dependency-->
        <dependency>
                <groupId>org.camunda.bpm.extension</groupId>
                <artifactId>camunda-bpm-process-test-coverage</artifactId>
                <version>0.3.0</version>
                <scope>test</scope>
	    </dependency>
   	
		<!-- SpringBoot Actuator - Endpoint inspections -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

       <!-- Java Mail : spring-context-support -->
       <dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-mail</artifactId>
		</dependency>

		<dependency>
    	    <groupId>org.springframework</groupId>
            <artifactId>spring-support</artifactId>
            <version>2.0.6</version>
		</dependency>
			
	</dependencies>
    <dependencyManagement>
		<dependencies>
			<dependency>
			    <!-- Import dependency management for spring cloud -->
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
            <!-- Import dependency management for camunda -->
            <dependency>
               <groupId>org.camunda.bpm</groupId>
               <artifactId>camunda-bom</artifactId>
               <version>${camunda.version}</version>
               <scope>import</scope>
               <type>pom</type>
             </dependency>
		</dependencies>
	</dependencyManagement>	
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
<!-- adding properties to generate the  build-info.properties (Start)-->				
				<executions>
		          <execution>
		            <goals>
		              <goal>build-info</goal>
		            </goals>
		            <configuration>
		              <additionalProperties>
		                <encoding.source>UTF-8</encoding.source>
		                <encoding.reporting>UTF-8</encoding.reporting>
		                <java.source>${maven.compiler.source}</java.source>
		                <java.target>${maven.compiler.target}</java.target>
		              </additionalProperties>
		            </configuration>
		          </execution>
		        </executions>
<!-- adding properties to generate the  build-info.properties (End)-->		        
			</plugin>
		</plugins>
	</build>

</project>

Thanks in advance
Giuseppe

You didn’t define property “${camundaSpringBoot.version}” in your pom . I changed that with camunda.version and was able to call REST api.

Thanks a lot for your support. I solved the problem by generating a new pom.xml file with Camunda start.
After modified the pom.xml, during a compilation, I observed the download of rest-api and webapp jars:

Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-rest/7.14.0/camunda-bpm-spring-boot-starter-rest-7.14.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-rest/7.14.0/camunda-bpm-spring-boot-starter-rest-7.14.0.pom (2.0 kB at 3.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/camunda-engine-rest-jaxrs2/7.14.0/camunda-engine-rest-jaxrs2-7.14.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/camunda-engine-rest-jaxrs2/7.14.0/camunda-engine-rest-jaxrs2-7.14.0.pom (9.2 kB at 41 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp/7.14.0/camunda-bpm-spring-boot-starter-webapp-7.14.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp/7.14.0/camunda-bpm-spring-boot-starter-webapp-7.14.0.pom (1.3 kB at 5.9 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp-core/7.14.0/camunda-bpm-spring-boot-starter-webapp-core-7.14.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp-core/7.14.0/camunda-bpm-spring-boot-starter-webapp-core-7.14.0.pom (3.2 kB at 14 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-rest/7.14.0/camunda-bpm-spring-boot-starter-rest-7.14.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/camunda-engine-rest-jaxrs2/7.14.0/camunda-engine-rest-jaxrs2-7.14.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp/7.14.0/camunda-bpm-spring-boot-starter-webapp-7.14.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp-core/7.14.0/camunda-bpm-spring-boot-starter-webapp-core-7.14.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar (160 kB at 1.2 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-rest/7.14.0/camunda-bpm-spring-boot-starter-rest-7.14.0.jar (8.3 kB at 35 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp/7.14.0/camunda-bpm-spring-boot-starter-webapp-7.14.0.jar (2.0 kB at 7.4 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/springboot/camunda-bpm-spring-boot-starter-webapp-core/7.14.0/camunda-bpm-spring-boot-starter-webapp-core-7.14.0.jar (18 kB at 59 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/camunda/bpm/camunda-engine-rest-jaxrs2/7.14.0/camunda-engine-rest-jaxrs2-7.14.0.jar (848 kB at 1.5 MB/s)

Now REST API works fine.

Thanks a lot for your support.

Giuseppe

Last problem is with the cockpit. I started the camunda web page but both cockpit and the tasklist pages are always white (without any data).
In camunda 7.8 the cockpit worked fine…Is in Camunda 7.14 necessary to configure any parameters?

Thanks in advance
Best regards
Giuseppe

No, it should work by default.

Hi,

the same problem with Camunda Cockpit 7.14 has been observed by another user in the forum page

https://forum.camunda.io/t/cockpit-white-page/24051/5

but without solution (Cockpit white page).