Camunda Cockpit with different Runtime Container

1,368 views
Skip to first unread message

friedl.c...@gmail.com

unread,
Aug 6, 2015, 6:30:35 AM8/6/15
to camunda BPM users
Hi,

as I understand, the Camunda Cockpit commnuicates with the proces-engine via REST. In the architecture overview shown in the Camunda doc (http://docs.camunda.org/latest/assets/img/architecture-overview.png), the engine and the cockpit reside in the same runtime container. - Why?

My question is: Since, they communiucate via REST - How can I run the Cockpit in a completely different container as the engine and still access the process engine?
How can I configure the Cockpit to point to the REST service of my application running the engine?

Cheers
Chris

thorben....@camunda.com

unread,
Aug 7, 2015, 8:54:11 AM8/7/15
to camunda BPM users, friedl.c...@gmail.com
Hi Chris,

Cockpit adds some additional REST resources and backend functions that must be integrated into the Cockpit web application due to its current architecture (the same holds for Cockpit plugins, where we enable to users to add custom REST resources and database queries). That's why the Cockpit webapplication has a backend that accesses process engine and thus directly the database. The reasoning behind this approach is that it makes it simple to extend frontend and backend in Cockpit, since it is one artifact you have to deal with. The downside is amongst others that you cannot separate backend and frontend easily.

Changing the Cockpit architecture to a more separate approach is something we are aware of as users from occasionally request this. Yet, we need a strong motivation why we should invest the effort to actually do it.

Best regards,
Thorben

friedl.c...@gmail.com

unread,
Aug 7, 2015, 9:50:49 AM8/7/15
to camunda BPM users, friedl.c...@gmail.com
Thank you Thorben.

I am not quite sure if I understood you well. You say:

"... That's why the Cockpit webapplication has a backend that accesses process engine ...".

How does it access the process engine? How and where must the process engine be configured so the cockpit application has access?

I have the process engine defined as spring bean (ManagedProcessEngineFactoryBean) in the spring context of my own application.
Is there any way I can configure a Cockpit to point to my process engine? The Cockpit could also run in the same container as my application.

Cheers

thorben....@camunda.com

unread,
Aug 10, 2015, 3:24:26 AM8/10/15
to camunda BPM users, friedl.c...@gmail.com
Hi Chris,

That depends on the setup, whether you use a shared or embedded process engine [1].

When you register a shared process engine (as ManagedProcessEngineFactoryBean does) AND run Cockpit on the same application server, you can use the regular Camunda webapp that looks up shared engines in the container (it actually uses BpmPlatform#getProcessEngineService#getProcessEngine(..))

When that is not the case, you can use the standalone Camunda webapp. In addition to the regular webapp, it contains the Camunda engine libraries and configures an embedded process engine (as part of the WAR deployment). See [2] for how to customize the configuration of the standalone webapp.

Cheers,
Thorben

[1] http://docs.camunda.org/7.3/guides/user-guide/#introduction-architecture-overview-camunda-bpm-platform-architecture
[2] http://docs.camunda.org/7.3/guides/installation-guide/standalone/

friedl.c...@gmail.com

unread,
Aug 10, 2015, 10:08:39 AM8/10/15
to camunda BPM users, friedl.c...@gmail.com
Thanks again.

Option one is what I need. I read the installation guide for a vanilla Tomcat installation. But I am not sure how to put this all together.

I downloaded the pre packaged tomcat installation. I unpacked it and copied the "camunda" folder to my webapps folder of my tomcat where my application with the process engine is running.
I took also the jar files of the lib directory of the pre packaged tomcat and copied it to my own tomcat.

Further, the installation guide tells to put the bpm-platform.xml to the tomcat-conf directory. As far as I can tell - this file would configure its own process-engine. And this is what I do not want at all, because (this is the topic of the thread) I want to use my own already existing (shared) process-engine.
The installation guide also tells to configure the datasource. If I already have a shared process-engine in my container, the cockpit should not need another db-connection.

I use java melody in my webapp and there I can identify an MBean of type

org.camunda.bpm.platform.process-engine

with the name of my configured proces-engine. So I assume, the process-engine is available in the container.
If I do not specify the bpm-platform.xml - I get an error when accessing the "camunda" webapp:

"org.camunda.bpm.webapp.impl.IllegalWebAppConfigurationException: No process engine found. camunda Webapp cannot work without a process engine.
org.camunda.bpm.webapp.impl.engine.ProcessEnginesFilter.getDefaultEngineName(ProcessEnginesFilter.java:168)"

Could you please help me by providing the necessary steps to run the cockpit on a tomcat with an already running process engine?

Chris

PS: Just for testing purpose - I configured the camunda app as told in the installation guide, and it worked. But this was just another process engine with direct access to the database.

Christian Lipphardt

unread,
Aug 10, 2015, 10:16:12 AM8/10/15
to camunda BPM users, friedl.c...@gmail.com
Hi Chris,

What you need to to is to put all camunda-related libs into your tomcat/lib directory (but not camunda CDI/Spring modules). Remove all camunda-related modules from your webapp but leave camunda-spring in it. Then it should work. Because of classloader isolation Cockpit is using the engine from tomcat/lib, but your spring application is probably bundling camunda-engine itself. So Cockpit cannot access the correct BpmPlatform class to get a hold on your process engine.

Cheers,
Christian

friedl.c...@gmail.com

unread,
Aug 10, 2015, 11:42:36 AM8/10/15
to camunda BPM users, friedl.c...@gmail.com
Thank you Christian!

Your advice seems to have some effect. When I call the camunda webapp now - I get automatically redirected to the process engine.
Let's say - I call http://localhost:8080/camunda
The adress is changed to http://localhost:8080/camunda/app/cockpit/my-own-process-engine

So, it seems the camunda webapp does know about my process engine. Nevertheless, after the redirect, I get an HTTP 404 error. It looks like I am missing the last tweak now.
Is there any configuration file I have to adapt?

Chris

thorben....@camunda.com

unread,
Aug 10, 2015, 11:54:42 AM8/10/15
to camunda BPM users, friedl.c...@gmail.com
Hi Chris,

Have you cleared your browser's cache? What is the request that returns a 404 (or is it http://localhost:8080/camunda/app/cockpit/my-own-process-engine)?

Cheers,
Thorben

friedl.c...@gmail.com

unread,
Aug 11, 2015, 3:16:44 AM8/11/15
to camunda BPM users, friedl.c...@gmail.com
Hi,

the request is simply
http://localhost:8080/camunda
The address is then automagically extended to
http://localhost:8080/camunda/app/cockpit/my-own-process-engine
in my browser address field (tested with Chrome and Firefox).
If I change the name of my process engine - the extension also uses the new name. So the must be at least something working right in the background.

Christian Lipphardt

unread,
Aug 11, 2015, 3:47:26 AM8/11/15
to camunda-...@googlegroups.com
The WebApp is using the correct engine now. Please give us details on
the 404 request.
signature.asc

friedl.c...@gmail.com

unread,
Aug 11, 2015, 4:36:41 AM8/11/15
to camunda BPM users
Well, I just used the developer tools of chrome to get teh full request headers. Hopefully this is what you ment.

my request:

Remote Address:127.0.0.1:8080
Request URL:http://localhost:8080/camunda/app/cockpit/
Request Method:GET
Status Code:302 Found
Response Headers
view parsed
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Location: http://localhost:8080/camunda/app/cockpit/my-engine/
Content-Length: 0
Date: Tue, 11 Aug 2015 08:13:25 GMT
Request Headers
view parsed
GET /camunda/app/cockpit/ HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36
Referer: http://localhost:8080/camunda/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: JSESSIONID=5C4C444424B147187A72BB7C5A2D7A1B

redirect:

Remote Address:127.0.0.1:8080
Request URL:http://localhost:8080/camunda/app/cockpit/my-engine/
Request Method:GET
Status Code:404 Not Found
Response Headers
view parsed
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1011
Date: Tue, 11 Aug 2015 08:13:25 GMT
Request Headers
view parsed
GET /camunda/app/cockpit/my-engine/ HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36
Referer: http://localhost:8080/camunda/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: JSESSIONID=5C4C444424B147187A72BB7C5A2D7A1B

The response is the 404 error site of my tomcat

<html><head><title>Apache Tomcat/7.0.62 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /camunda/app/cockpit/my-engine/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/camunda/app/cockpit/my-engine/</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.62</h3></body></html>

friedl.c...@gmail.com

unread,
Aug 11, 2015, 5:05:43 AM8/11/15
to camunda BPM users
Some additional information that may help:

When I manually enter the address to the "default" engine:

http://localhost:8080/camunda/app/cockpit/default/

I get at least the logon screen returned by my tomcat.
There is a "warning" of course, that there is no process engine available with the name "default"

"The process engine you are trying to access does not exist"

I can also write some random process engine name like "llalalu" and the same thing occurs. Only when I use the only engine name that really exists - I get the 404 error.

thorben....@camunda.com

unread,
Aug 11, 2015, 5:22:15 AM8/11/15
to camunda BPM users, friedl.c...@gmail.com
Hi Chris,

I knew there was a bug for this but couldn't put my finger on it. Now I found it: https://app.camunda.com/jira/browse/CAM-3500

So the workaround would be to not use a hyphen in the engine name.

Feel free to vote for the ticket.

Cheers,
Thorben

friedl.c...@gmail.com

unread,
Aug 11, 2015, 6:31:34 AM8/11/15
to camunda BPM users, friedl.c...@gmail.com
Hell yeah - that's it!

Hyphen in the engine name...

Thanks a lot! Saved my day.

Cheers
Chris

Reply all
Reply to author
Forward
0 new messages