I can see that these URLs are different little bit. But i use the same process definition key which is finex-CA. I don’t provide a tenant id in here. but it starts the BPM.
Based on the error I think your deployment was not successful. Please check the Deployment details via cockpit and the try to start.
Also Check whether executable property is clicked.
If same problem then you can share your BPMN.
My BPM started with this api. Then i closed camunda and created a spring boot application with camunda and i tried to start my previously uploaded BPM using the REST API inside the app. This is the url that i used for that → http://localhost:8080/rest/process-definition/key/finex-CA/start
But it wont start and it gives me this error
No matching process definition with key: finex-CA and no tenant-id
As per your Error that is clear that your deployment was not Success.
Please find below ways to find whether your deployment is Success.
Check the Spring boot log(Console) So that you can find deployment Id with Process Key.
If you use “camunda-bpm-spring-boot-starter-webapp” in your pom.xml You can able to launch Camunda cockpit Application and so that you can check whether the deployment is Success. If Success and you can try testing the bpmn from the same application and then if all goes well trying using with Spring Boot.
3.Did you add any properties in application.properties that restrict deployment.
I added this dependency in my pom file. <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId> <version>3.2.0</version> </dependency>
I didn’t deploy my BPM using my spring boot application. I deployed my BPM seperately using postman. Then i took that process definition key and i tried to start the BPM inside my spring boot application. (My process definition key is “factoring-finex-CA”) Then i got this error.
2020-03-04 15:29:26.939 WARN 10721 — [nio-8080-exec-3] ExceptionHandler : org.camunda.bpm.engine.rest.exception.RestException: No matching process definition with key: factoring-finex-CA and no tenant-id
at org.camunda.bpm.engine.rest.impl.ProcessDefinitionRestServiceImpl.getProcessDefinitionByKey(ProcessDefinitionRestServiceImpl.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Confirm me the steps are correct
1.You started Camunda-Starter Script.
2. Deployed Bpmn Via postman.
3. Started Spring Boot Application.
4. Used Restapi in Spring Boot application and it throws error.
I got the root cause. yes after 2nd step you need to close the camunda so that only you can able to start Spring app.
The reason is clear, When ever you start camunda Script an engine (Engine1) will start with some h2 DB. (Example:DB1)
So in the second step you can able to deploy the process and all the data will store in that h2 DB. (Example:DB1) with the help of (Engine1)
In the third step when you start spring boot again an camunda new engine (Engine2) will try to start. Since you Stopped Engine 1,Engine 2 is starting without Error.
But in these Case the Engine 2 is using some other H2 DB (DB2).
In fourth step you are using Engine2 with DB2 to start the process and it throws error.
Here the problem is not using Multiple engines but all the engines you are using should connect same DB. Since all your deployment stores in DB.
To validate these you check the below file in camunda folder
camunda-bpm-tomcat-7.12.0\server\apache-tomcat-9.0.24\conf\server.xml (You can find the h2 DB details that is going to start) and Spring Boot log where you can see h2 db details. you can find different DB details.
Hey thank you for the reply, i did like you said, now It don’t give the previous error. Now it gives me this error saying Nullpointerexception
2020-03-05 10:25:41.230 ERROR 6517 — [nio-8080-exec-6] c.b.s.b.s.r.CamundaJerseyResourceConfig] : Servlet.service() for servlet [org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig] in context with path threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
at org.camunda.bpm.engine.rest.sub.repository.impl.ProcessDefinitionResourceImpl.startProcessInstanceAtActivities(ProcessDefinitionResourceImpl.java:157) ~[camunda-engine-rest-jaxrs2-7.10.0.jar:7.10.0]
at org.camunda.bpm.engine.rest.sub.repository.impl.ProcessDefinitionResourceImpl.startProcessInstance(ProcessDefinitionResourceImpl.java:123) ~[camunda-engine-rest-jaxrs2-7.10.0.jar:7.10.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76) ~[jersey-server-2.27.jar:na]
i found the error here, when i start the BPM using th eRESP API, i havent provide the relevant post data payload which is an empty json. Now that i have used it with post request, it worked fine. Gave me status code of 200.
This due to when you embedded the Caminda in a Spring Boot Application it will start a new Server for the process definition for this project. The previous depolyment is on the sandalone server so there are using different memories to strore the process definitions. That’s why you can’t able to run your previous deployed BPM on embedded camunda engine.