Cannot access rest endpoint for engine


#1

I am trying to use camunda with springboot. I am able to get it running using default pom.xml. I created a sample application as well. I modeled a simple process using a modeler. Now I am trying to deploy it. I am not able to find the deploy button in the cockpit as I only have the free version. I see a deploy button in the modeler. However, when I try to access the default engine through postman, I get a 404. I have tried all combinations.
http://localhost:8080/engine-rest/engine

etc etc.
Below is my eclipse output when I start the springboot project


/ | __ _ _ __ ___ _ _ _ __ | | __ _ | __ )| _ | / |
| | / | '_ _ | | | | ’ \ / |/ _ | | _ | |) | |/| |
| |
| (
| | | | | | | |
| | | | | (
| | (| | | |) | /| | | |
_
/_,|| || ||_,|| ||_,|_,| |_/|| || ||

Spring-Boot: (v2.1.1.RELEASE)
Camunda BPM: (v7.10.0)
Camunda BPM Spring Boot Starter: (v3.2.0)

2019-05-14 17:50:43.012 INFO 1400 — [ main] S.ShivaCamundaSpBootApplication : Starting ShivaCamundaSpBootApplication on L106465G8325VFH with PID 1400 (C:\Users\shkrish\eclipse-lambda\ShivaCamundaSPBoot\target\classes started by shkrish in C:\Users\shkrish\eclipse-lambda\ShivaCamundaSPBoot)
2019-05-14 17:50:43.017 INFO 1400 — [ main] S.ShivaCamundaSpBootApplication : No active profile set, falling back to default profiles: default
2019-05-14 17:50:44.321 INFO 1400 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-05-14 17:50:44.344 INFO 1400 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-05-14 17:50:44.345 INFO 1400 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
2019-05-14 17:50:44.352 INFO 1400 — [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_191\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files\Serena\vm\win32\bin;C:\Program Files\Serena\vm\common\bin\win32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\WINDOWS\CCM;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files (x86)\ibm\gsk8\bin;C:\Program Files (x86)\IBM Informix Connect\bin;C:\Program Files (x86)\Serena\vm\win32\bin;C:\Program Files (x86)\Serena\vm\common\bin\win32;C:\ora11g\product\11.2.0\client_2\bin;c:\windows\SysWow64;c:\Program Files (x86)\Intel\iCLS Client;c:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;c:\Program Files\Stellent\IBPM;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Sybase\Shared\PowerBuilder;C:\Program Files\nodejs;C:\Users\shkrish\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Microsoft VS Code\bin;C:\Users\shkrish\AppData\Roaming\npm;C:\Users\shkrish\AppData\Local\GitHubDesktop\bin;C:\Users\shkrish\AppData\Local\Programs\Microsoft VS Code\bin;C:\WINDOWS\system32;;.]
2019-05-14 17:50:44.550 INFO 1400 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-05-14 17:50:44.551 INFO 1400 — [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1479 ms
2019-05-14 17:50:45.127 INFO 1400 — [ main] o.s.j.d.e.EmbeddedDatabaseFactory : Starting embedded database: url=‘jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false’, username=‘sa’
2019-05-14 17:50:45.230 INFO 1400 — [ main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
2019-05-14 17:50:45.233 INFO 1400 — [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘camundaTaskExecutor’
2019-05-14 17:50:45.302 INFO 1400 — [ main] org.camunda.bpm.engine.cfg : ENGINE-12003 Plugin ‘CompositeProcessEnginePlugin[genericPropertiesConfiguration, camundaProcessEngineConfiguration, camundaDatasourceConfiguration, camundaJobConfiguration, camundaHistoryConfiguration, camundaMetricsConfiguration, camundaAuthorizationConfiguration, CreateAdminUserConfiguration[adminUser=AdminUserProperty[id=kermit, firstName=Kermit, lastName=Kermit, email=kermit@localhost, password=superSecret]], failedJobConfiguration, CreateFilterConfiguration[filterName=All tasks], disableDeploymentResourcePattern]’ activated on process engine ‘default’
2019-05-14 17:50:45.306 INFO 1400 — [ main] org.camunda.bpm.spring.boot : STARTER-SB020 ProcessApplication enabled: autoDeployment via springConfiguration#deploymentResourcePattern is disabled
2019-05-14 17:50:48.733 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘engine’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.engine.sql’
2019-05-14 17:50:48.770 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘history’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.history.sql’
2019-05-14 17:50:48.783 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘identity’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.identity.sql’
2019-05-14 17:50:48.803 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘case.engine’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.case.engine.sql’
2019-05-14 17:50:48.811 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘case.history’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.case.history.sql’
2019-05-14 17:50:48.821 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘decision.engine’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.decision.engine.sql’
2019-05-14 17:50:48.831 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation ‘create’ on component ‘decision.history’ with resource ‘org/camunda/bpm/engine/db/create/activiti.h2.create.decision.history.sql’
2019-05-14 17:50:48.855 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03067 No history level property found in database
2019-05-14 17:50:48.855 INFO 1400 — [ main] org.camunda.bpm.engine.persistence : ENGINE-03065 Creating historyLevel property in database for level: HistoryLevelFull(name=full, id=3)
2019-05-14 17:50:48.892 INFO 1400 — [ main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
2019-05-14 17:50:49.012 INFO 1400 — [ main] org.camunda.bpm.spring.boot : STARTER-SB010 creating initial Admin User: AdminUserProperty[id=kermit, firstName=Kermit, lastName=Kermit, email=kermit@localhost, password=superSecret]
2019-05-14 17:50:49.024 INFO 1400 — [ main] org.camunda.bpm.spring.boot : STARTER-SB015 create initial filter: id=b7ae37cf-769a-11e9-a1a6-2216b9fec252 name=All tasks
2019-05-14 17:50:49.249 INFO 1400 — [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’
2019-05-14 17:50:49.524 INFO 1400 — [ main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazyProcessEnginesFilter@5f462e3b
2019-05-14 17:50:49.641 INFO 1400 — [ main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazySecurityFilter@726a6b94
2019-05-14 17:50:49.834 INFO 1400 — [ main] org.camunda.bpm.container : ENGINE-08026 No processes.xml file found in process application ‘shivaCamundaSpBootApplication’
2019-05-14 17:50:49.838 INFO 1400 — [ main] org.camunda.bpm.container : ENGINE-08050 Process application shivaCamundaSpBootApplication successfully deployed
2019-05-14 17:50:49.866 INFO 1400 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’
2019-05-14 17:50:49.870 INFO 1400 — [ main] S.ShivaCamundaSpBootApplication : Started ShivaCamundaSpBootApplication in 7.355 seconds (JVM running for 8.531)
2019-05-14 17:50:49.873 INFO 1400 — [ main] org.camunda.bpm.engine.jobexecutor : ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor].
2019-05-14 17:50:49.874 INFO 1400 — [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14018 JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor] starting to acquire jobs
2019-05-14 17:51:33.224 INFO 1400 — [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet ‘dispatcherServlet’
2019-05-14 17:51:33.224 INFO 1400 — [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet ‘dispatcherServlet’
2019-05-14 17:51:33.235 INFO 1400 — [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 11 ms
2019-05-14 17:51:38.043 WARN 1400 — [nio-8080-exec-8] o.glassfish.jersey.servlet.WebComponent : A servlet request to the URI http://localhost:8080/api/admin/auth/user/default/login/cockpit contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.


#2

for Spring boot try this:


#3

still not working


#4

What call are you making and what response are you getting?


#5


#6

I see - so you’re just sending something to the endpoint. You’re not actually sending a specific rest call. Try something like

localhost:8080/rest/task

and you should see either a list of tasks or just empty braces.


#7

Here is what I want to accomplish.
I want to deploy the process I created which is the simple process in your java tutorial with one service task node, a start and end. I have a java class that it can call which simply types helloworld. Nothing to brag about here. In order for me to deploy the xml file, I need the rest end point, I did not even know the default engine name until I dug a little deeper. It looks like it is called default !! That said, I wanted to call a rest api that returned all the engines running. Ultimately I want to call /deployment/create supplying it an xml file. But, I cannot even access a single resource through the REST call. Get 404 everytime.
I just wanted to give you a context.


#8

It does not even look like any of the rest end points are even deployed


#9

Have you added the rest api to the POM file of your spring boot application?


#10
4.0.0 org.camunda.bpm.getstarted loan-approval-spring-boot 0.0.1-SNAPSHOT org.springframework.boot spring-boot-dependencies 2.1.1.RELEASE pom import org.camunda.bpm.springboot camunda-bpm-spring-boot-starter-webapp 3.2.0 org.springframework.boot spring-boot-starter-web
<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
</dependency>
org.springframework.boot spring-boot-maven-plugin ZIP repackage

#11

Maybe take a look at this: https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/rest-api/


#12
org.camunda.bpm.springboot camunda-bpm-spring-boot-starter-webapp 3.2.0 org.springframework.boot spring-boot-starter-web
<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
</dependency>
org.springframework.boot spring-boot-maven-plugin ZIP repackage

#13

the rest api now works, Have no Idea How, I missed this dependency


#14

Glad to hear it’s working - have fun!


#15

Now I need to deploy the process.
Is it
http://localhost:8080/rest/engine/deployment/create I type in this box ?


#16

Take out engine


#17

deployed now. Let me test. I am almost there !!


#18

How do I run this task ?


#19


#20

I see the following in my springboot console

ENGINE-08026 No processes.xml file found in process application ‘shivaCamundaSpBootApplication’