Running Cockpit with Spring-configured embedded process engine and REST API

1,249 views
Skip to first unread message

steffen....@gmail.com

unread,
Nov 4, 2013, 4:05:12 AM11/4/13
to camunda-...@googlegroups.com
Hi,

a while ago I got Camunda BPM running when following this quickstart.

https://github.com/camunda/camunda-quickstarts/tree/master/deployment/embedded-spring-rest

This still works like charm but now I wanted to add Cockpit in order to ease maintainance of running processes.

I tried to follow your installation guide at http://docs.camunda.org/latest/guides/installation-guide/tomcat/#web-applications-install-camunda-cockpit-and-tasklist but starting the Tomcat server with the camunda-webapp-tomcat-7.0.0-Final.war deployed results in this:

INFO: Deploying web application archive D:\Tomcats\apache-tomcat-7.0.42\webapps\camunda-webapp-tomcat-7.0.0-Final.war
Nov 04, 2013 9:38:22 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.camunda.bpm.cockpit.impl.web.bootstrap.CockpitContainerBootstrap
java.lang.NoClassDefFoundError: org/camunda/bpm/engine/ProcessEngineException
at org.camunda.bpm.cockpit.impl.web.bootstrap.CockpitContainerBootstrap$CockpitEnvironment.setup(CockpitContainerBootstrap.java:56)
at org.camunda.bpm.cockpit.impl.web.bootstrap.CockpitContainerBootstrap.contextInitialized(CockpitContainerBootstrap.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.ProcessEngineException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 16 more

Nov 04, 2013 9:38:22 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Nov 04, 2013 9:38:22 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/camunda-webapp-tomcat-7.0.0-Final] startup failed due to previous errors


The embedded engine is still starting fine, but the WebApp runs into this error. Any idea on what I am doing wrong?

Thanks,

Steffen

Daniel Meyer

unread,
Nov 4, 2013, 8:17:16 AM11/4/13
to camunda-...@googlegroups.com, steffen....@gmail.com
Hi Steffen,

in the default configuration, the camunda webapplication does not bundle and configure a process engine. The reason is that if you use the camunda-bpm tomcat distribution, the process engine is avaliable as container service to all applications and 
- thus packaged as a library in the tomcat/lib folder
- started by a tomcat server lifecycle listener (see server.xml)

If you want to deploy the camunda webapp stanadalone, with an embedded process engine, you would have to add the camunda-engine.jar to the camunda-webapp.war file as a library and start the process engine yourself.

Cheers,
Daniel Meyer

Daniel Meyer

unread,
Nov 4, 2013, 8:21:19 AM11/4/13
to camunda-...@googlegroups.com, steffen....@gmail.com
Hi Steffen,

as an addition to my previous comment:

you would have to 
- do a maven overlay adding the camunda-engine.jar to the camunda-webapp.war
- implement the org.camunda.bpm.engine.rest.spi.ProcessEngineProvider to provide a process engine

Question: would you be interested in being able to download a standalone cockpit distribution like this form camunda.org ?

Regards,
Daniel Meyer

steffen....@gmail.com

unread,
Nov 5, 2013, 8:16:35 AM11/5/13
to camunda-...@googlegroups.com, steffen....@gmail.com
Hi Daniel,

I am not 100% sure that I understand you correctly.

If I include the engine as a jar-library how will it run then standalone / how is it started? It is currently running as a war on my Tomcat and starting with it. I have no experience with the lifecycle listener that you mentioned but I will look into it.

Best,
Steffen

Daniel Meyer

unread,
Nov 5, 2013, 8:26:26 AM11/5/13
to camunda-...@googlegroups.com

Hi Steffen,

 

Let me explain it in more detail:

 

If you deploy multiple applications on camunda BPM where each of them uses the process engine you have two options:

 

1) Run the process engine embedded:

In this case the camunda-engine.jar library is added to each application and the process engine is started inside each application.

               

 

2) Run the process engine in shared (container-managed) mode:

In this case the process engine is started by the Tomcat server as part of the tomcat server bootstrap. It can then be used by multiple applications (such as your custom process application and the camunda cockpit). In this case the camunda-engine.jar must not be added to each application but deployed as a shared library.

 

See also: http://docs.camunda.org/latest/guides/user-guide/#introduction-architecture-overview-camunda-bpm-platform-architecture

 

You opted for option (1 - embedded). In this case you need to add the process engine to the cockpit application and start it there. You do not have to look into the server listener as this is used for option (2).

What you have to do is provide an implementation of the ProcessEngineLookup SPI in the same way as you did in your custom application. You could then also boostrap the process engine using Spring in cockpit and provide it to the cockoit application in the same way as you do in your custom application.

 

We are thinking about providing a cockpit application where this is pre-configured.

 

Cheers,

Daniel Meyer

Bernd Rücker (camunda)

unread,
Nov 5, 2013, 9:11:47 AM11/5/13
to camunda-...@googlegroups.com

Hi Steffen.

 

Why don’t you consider to switch to the shared engine (option 2)? I expect that it works more smoothly for you. I am just curious ;-)

 

Cheers

BErnd

--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/7e9e9fc1.00001c2c.0000009e%40CA-MEYERD.
For more options, visit https://groups.google.com/groups/opt_out.

steffen....@gmail.com

unread,
Nov 5, 2013, 10:13:06 AM11/5/13
to camunda-...@googlegroups.com
Hi,

thank you for that detailed explanation of both modes of operation, Daniel. I guess I was not fully aware of what "embedded" means. Actually, option 2 seems to better fit my requirements. Isn't option 2 what is provided by that bundle which you provide for download (for Tomcat, Glassfish and JBoss AS)?
I am currently alse tinkering around with it and it seems just to be easier to handle than the embedded version.

Thank you very much for your detailed answers so far!

Cheers,
Steffen

Daniel Meyer

unread,
Nov 5, 2013, 10:22:35 AM11/5/13
to camunda-...@googlegroups.com, steffen....@gmail.com
Hi Steffen, 

> Isn't option 2 what is provided by that bundle which you provide for download (for Tomcat, Glassfish and JBoss AS)? 

Yes, indeed. Let us know if you need assistance for porting your application to that environment. 

Cheers,
Daniel Meyer

aren...@gmail.com

unread,
Oct 21, 2015, 12:36:41 AM10/21/15
to camunda BPM users, steffen....@gmail.com
Hi Daniel

I have a spring web application uses bpmn work flow. So the engine is embedded. Now I hav a cockpit application [angular/js api] downloaded from the camunda. Can I see the tasks and details if I put this cockpit webapp to the root folder where my custom spring web application is running.

I prefer a step by step explantion since i am new in camunda though we implementing it on the way a big process.
[what we are implementing - approval process by multiple organizations having different business process of dealing a single service receiving the assignment to different level of people in each organizations]
Mean while I would like to get shared a detailed implementation of
1. Adding Camunda to an application
2. Running a process
3. Assign a task runtime
4. Delegate / change the assignee
5. Complete the task
6. Messaging
7. View all the tasks for assignee/Candidate

in a single document with the api methods that exactly fit for an end to end application.

Reply all
Reply to author
Forward
0 new messages