# Unable to load class for custom process

**URL:** <https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [November 4, 2019, 2:26pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015 "2019-11-04T14:26:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 4, 2019, 2:26pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/1 "2019-11-04T14:26:08Z")

</div>

Hi forum, we developed a custom process (“menu.planer.war”) and have problems deploying it to a server running tomcat using the standalone camunda war. The process works without problems in a freshly installed “pre-packaged” distribution with tomcat and camunda alfready configured.

The system is ubuntu 18.04, with tomcat 9.0.12 and OpenJDK 8. Vanilla camunda seems to work fine (deployed as a .war), and our custom process .war seems to load as well (see log at the end of this post).

However, if I use “start process” to create a custom process, camunda is not able to load our custom class:

Nov 04 11:22:50 slappt01 tomcat9[25273]: ENGINE-16004 Exception while closing command context: ENGINE-09008 Exception while instantiating cla  
ss ‘net.cibex.menuplaner.delegates.StartInstancesDelegate’: ENGINE-09017 Cannot load class ‘net.cibex.menuplaner.delegates.StartInstancesDelegate’: net.cibex.menuplaner.delegates.StartInstancesDelegate Nov 04 11:22:50 slappt01 tomcat9[25273]: org.camunda.bpm.engine.ProcessEngineException: ENGINE-09008 Exception while instantiating class ‘net  
.cibex.menuplaner.delegates.StartInstancesDelegate’: ENGINE-09017 Cannot load class ‘net.cibex.menuplaner.delegates.StartInstancesDelegate’: net.cibex.menuplaner.delegates.StartInstancesDelegate

While trying to narrow down this problem I used strace to find out where tomcat looks for the corresponding .class-File, and it does so in CATALINA\_BASE/lib, CATALINA\_HOME/lib, and under WEB-INF/classes of the camunda webapp itself. I guess this is to be expected as per the settings in catalina.properties.

However, the correct path for the .class-file in question would be here:  
/var/lib/tomcat9/webapps/menu-planer/WEB-INF/classes/net/cibex/menuplaner/delegates/StartInstancesDelegate.class

Everything I see seems to go according to what I read in the tomcat classloader documentation. My question now is, what is done to the pre-packaged distribution so this setup with classes in different webapps is working?

Other things I checked:

- tomcat security manager is not enabled on our system
- file system permissions are ok
- I compared a lot of configuration files between the pre-packaged distribution and our vanilla standalone version, but could not find anything helpful

Thanks in advance for any pointers.

Urban / cibex GmbH

–

Here is the relevant log excerpt from tomcat startup:

Nov 04 11:22:03 slappt01 tomcat9[25273]: Deploying web application archive [/var/lib/tomcat9/webapps/menu-planer.war]  
Nov 04 11:22:07 slappt01 tomcat9[25273]: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger fo  
r a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time a  
nd JSP compilation time.  
Nov 04 11:22:07 slappt01 tomcat9[25273]: ENGINE-07015 Detected @ProcessApplication class ‘net.cibex.menuplaner.CamundaBpmProcessApplication’  
Nov 04 11:22:07 slappt01 tomcat9[25273]: ENGINE-08024 Found processes.xml file at file:/var/lib/tomcat9/webapps/menu-planer/WEB-INF/classes/M  
ETA-INF/processes.xml  
Nov 04 11:22:07 slappt01 tomcat9[25273]: ENGINE-08023 Deployment summary for process archive ‘hsj’:  
Nov 04 11:22:07 slappt01 tomcat9[25273]: hsj-menuebestellung.bpmn  
Nov 04 11:22:08 slappt01 tomcat9[25273]: ENGINE-07021 ProcessApplication ‘Menu App’ registered for DB deployments [e6408b91-e03c-11e9-a3bc-52  
5400eb9247, d0bbc21e-e8f8-11e9-b81f-525400eb9247, 3af658ec-e8f7-11e9-9a40-525400eb9247]. Will execute process definitions  
Nov 04 11:22:08 slappt01 tomcat9[25273]: P01[version: 1, id: P01:1:e65bdbc3-e03c-11e9-a3bc-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: Process\_17jlk1w[version: 1, id: Process\_17jlk1w:1:e65ced34-e03c-11e9-a3bc-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: P01[version: 3, id: P01:3:d0d45330-e8f8-11e9-b81f-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: Process\_17jlk1w[version: 3, id: Process\_17jlk1w:3:d0d6eb41-e8f8-11e9-b81f-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: P01[version: 2, id: P01:2:3b13a4ee-e8f7-11e9-9a40-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: Process\_17jlk1w[version: 2, id: Process\_17jlk1w:2:3b152b8f-e8f7-11e9-9a40-525400eb9247]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: Deployment does not provide any case definitions.  
Nov 04 11:22:08 slappt01 tomcat9[25273]: SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.json.jackson.format.JacksonJs  
onDataFormatProvider[name = application/json]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.xml.dom.format.DomXmlDataForm  
atProvider[name = application/xml]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormat[name =  
application/xml]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFor  
mat[name = application/json]  
Nov 04 11:22:08 slappt01 tomcat9[25273]: ENGINE-08050 Process application Menu App successfully deployed  
Nov 04 11:22:08 slappt01 tomcat9[25273]: Deployment of web application archive [/var/lib/tomcat9/webapps/menu-planer.war] has finished in [4,  
719] ms

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [November 4, 2019, 2:58pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/2 "2019-11-04T14:58:40Z")

</div>

Can you upload your process model?

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 5, 2019, 7:59am UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/4 "2019-11-05T07:59:03Z")

</div>

Wow, you guys are fast 🙂 Thanks for asking, process model is attached.[hsj-menuebestellung.bpmn](https://forum.camunda.io/uploads/short-url/1VGKjtKSAemTC6muVxc8n3tsGBp.bpmn) (8.8 KB)

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [November 5, 2019, 11:24am UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/5 "2019-11-05T11:24:16Z")

</div>

Hi, it looks like one of your listeners is set as an expression instead as a java class

 ![image](https://forum.camunda.io/uploads/default/original/2X/a/a6bf6c23bddfd0465afce511e97f90b5585701f5.png)

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 5, 2019, 12:51pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/6 "2019-11-05T12:51:45Z")

</div>

Thanks for pointing out!  
Unfortunately this wasn’t the problem. After fixing it, the module still didn’t work.

We still get the ‘cannot load class’-error.  
Hence the module runs without a problem in the bundled version of camunda, we think that the problem might be caused by the class-loading of the tomcat. I don’t think that the problem is caused by the bpmn file. Do you know if there are any tomcat-settings which control the loading of classes?  
Or is there anything else we can do, to enable the camunda-webapp to recognise our classes?

Thanks in advance  
Sebastian / cibex GmbH

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 5, 2019, 12:54pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/7 "2019-11-05T12:54:42Z")

</div>

Can you please explain this answer further?

Unfortunately I do not understand the purpose of running .java-Files.  
Hence we don’t run Java 11 or higher, we can’t compile classes at runtime. Therefore I don’t know how/why i should use .java-Files.

Thanks in advance  
Sebastian / cibex GmbH

---

<div class="post-metadata">

**Author:** ![aravindhrs](https://forum.camunda.io/user_avatar/forum.camunda.io/aravindhrs/32/32503_2.png) [@aravindhrs](https://forum.camunda.io/u/aravindhrs)\
**Post date:** [November 5, 2019, 4:17pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/8 "2019-11-05T16:17:34Z")

</div>

@cibex i have checked your bpmn, delegates are configured correctly, in addition to if you’ve corrected the delegates mentioned by @Niall in above post.

> [@cibex](#):
>
> We still get the ‘cannot load class’-error.  
> Hence the module runs without a problem in the bundled version of camunda, we think that the problem might be caused by the class-loading of the tomcat. I don’t think that the problem is caused by the bpmn file. Do you know if there are any tomcat-settings which control the loading of classes?  
> Or is there anything else we can do, to enable the camunda-webapp to recognise our classes?

**can you provide the server logs? can you upload your latest bpmn ?** Also make sure delegates are in classpath.

Also, **net.cibex.menuplaner.delegates.SetAssigneeDelegate** this deelegate is meant for assigning tasks, it should be configured in **event type = “assignment”** instead of “ **create** ” event of a task.

> [@cibex](#):
>
> ‘net.cibex.menuplaner.delegates.StartInstancesDelegate’:

upload this delegate for further analysis.

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 7, 2019, 11:34am UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/9 "2019-11-07T11:34:46Z")

</div>

> [@aravindhrs](#):
>
> if you’ve corrected the delegates mentioned by @Niall in above post.

Yes we corrected the mention from @Niall  
Unfortunately fixing the bpmn did not fix our problem.

> [@aravindhrs](#):
>
> Also, **net.cibex.menuplaner.delegates.SetAssigneeDelegate** this deelegate is meant for assigning tasks, it should be configured in **event type = “assignment”** instead of “ **create** ” event of a task.

I am not entirely sure if this would then still fulfil its purpose. For a better understanding: The **net.cibex.menuplaner.delegates.SetAssigneeDelegate** assigns the task to a person. I therefore think that changing the event type to “assignment” would brick the task.

> [@aravindhrs](#):
>
> Also make sure delegates are in classpath.

How do we configure the classpath? Hence we are in a custom environment we think that this might be the error.

net.cibex.menuplaner.CamundaBpmProcessApplication: [CamundaBpmProcessApplication - Pastebin.com](https://pastebin.com/2DZMyauz)  
net.cibex.menuplaner.delegates.SetAssigneeDelegate: [SetAssigneeDelegate - Pastebin.com](https://pastebin.com/viNQdnid)

If you need anything else, please let me know!

Thanks in advance  
Sebastian / cibex GmbH

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 7, 2019, 11:35am UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/10 "2019-11-07T11:35:38Z")

</div>

An here are the other files:

Log: [log.txt](https://forum.camunda.io/uploads/short-url/pVyxgBPlhxybXElzNgPKzHPiEKo.txt) (57.7 KB)  
and the BPMN: [hsj-menuebestellung.bpmn](https://forum.camunda.io/uploads/short-url/4nPbVr9YM3B1sYbsxQQBTSfGk8c.bpmn) (8.8 KB)

---

<div class="post-metadata">

**Author:** ![aravindhrs](https://forum.camunda.io/user_avatar/forum.camunda.io/aravindhrs/32/32503_2.png) [@aravindhrs](https://forum.camunda.io/u/aravindhrs)\
**Post date:** [November 7, 2019, 12:05pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/11 "2019-11-07T12:05:10Z")

</div>

@cibex in which directory this class was stored `net.cibex.menuplaner.delegates.StartInstancesDelegate` ?

Provide the complete path to the above class and also the code.

Deployed in clustered environment?

If the class is not in the classpath follow the below instructions:

**Tomcat JAR deployment options**

> How to make a JAR file available to your web applications at runtime. There are three recommended options to make this happen:
> 
> 1. Package the JAR file in the WEB-INF\lib folder of the Java web application;
> 2. Place the JAR file in the \lib subfolder of the Apache Tomcat installation;
> 3. Configure a folder for shared JAR files by editing Tomcat’s common.loader property in the catalina.properties file.

---

<div class="post-metadata">

**Author:** ![cibex](https://forum.camunda.io/user_avatar/forum.camunda.io/cibex/32/7776_2.png) [@cibex](https://forum.camunda.io/u/cibex)\
**Post date:** [November 7, 2019, 1:16pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/12 "2019-11-07T13:16:04Z")

</div>

So the path to our class: /var/lib/tomcat9/webapps/menu-planer/WEB-INF/classes/net/cibex/menuplaner/delegates/StartInstancesDelegate.class

And the code:

> **[SetAssigneeDelegate - Pastebin.com](https://pastebin.com/viNQdnid)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

We don’t build a Jar-File. We use the **camunda-archetype-servlet-war-7.11.1** archetype and build a war-file, which we then deploy in the webapp-directory of the tomcat.

> [@aravindhrs](#):
>
> Deployed in clustered environment?

No just a tomcat installation with the camunda war.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 12:01pm UTC](https://forum.camunda.io/t/unable-to-load-class-for-custom-process/16015/13 "2024-01-30T12:01:16Z")

</div>

Closed on January 30, 2024, 12:01pm UTC


