I have created my own Camunda Spring boot application and trying to use the Rest API for the same. getting 404 error.
Do I need to deploy engine-rest along with my application to access Rest API?
example I tried below
http://localhost:8080/process-definition/key/taskform/start
Please suggest me at the earliest?
2 Likes
Niall
January 23, 2020, 6:11am
2
If you’ve added the the REST API you should be able to test it via
localhost:8080/rest/engine
1 Like
is it maven dependency? please eleborate?
Niall
January 23, 2020, 6:23am
4
can you upload your pom file?
How did you create the application? did you use start.camunda.com
4.0.0
org.camunda.bpm.getstarted
loan-approval-spring-boot
0.0.1-SNAPSHOT
<properties>
<camunda.spring-boot.version>3.3.1</camunda.spring-boot.version>
<spring-boot.version>2.1.5.RELEASE</spring-boot.version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
<version>${camunda.spring-boot.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-core</artifactId>
<version>0.4.35</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-rest-core</artifactId>
<version>7.13.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-rest-jaxrs2</artifactId>
<version>7.13.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- dependencies only used for assemblies should be scope provided -->
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine</artifactId>
<version>7.13.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<packaging>war</packaging>
I get sample app from git, not started using http://start.camunda.com
I created new app using http://start.camunda.com and then accessed the following URL : localhost:8080/rest/engine so below is the output.
[{“name”:“default”}]
when I am trying with this
http://localhost:8080/process-definition/key/Pierian-Camunda-process/start , so getting 404 error? please suggest
1 Like
Niall
January 23, 2020, 7:00am
8
This means the REST API is working correctly.
The rest call is incorrect - you’re forgetting to add the rest
endpoint:
http://localhost:8080/**rest**/process-definition/key/Pierian-Camunda-process/start ,
2 Likes
@Niall . I have downloaded the package from start.camunda.com
i have selected the options REST API and WebApps under camunda modules.
However when i access the http://localhost:8080/rest/engine , i am getting No message content error. Please assist.
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sun May 31 09:01:56 IST 2020
There was an unexpected error (type=Not Found, status=404).
No message available
@Bharath_Kumar1 try with engine-rest
How are you accessing this api? Postman or browser or restclient?
If anyone is still getting this error, its important to have the following maven dependency in pom.xml to access the APIs:
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
<version>7.13.0</version>
</dependency>
After that it should be possible to call any of the Camunda REST API via Postman, curl etc e.g.
http://localhost:8080/camunda/engine-rest/engine
[
{
“name”: “default”
}
]
where camunda is set as context in my Springboot application.yaml:
server.servlet.context-path: /camunda
Hope it helps
Thanks
2 Likes