Unable to resolve class BpmnError

We try to experiment with an example for process idempotent check from: https://forum.camunda.org/t/idempotent-start-process-patterns/3315.

A similar usage of BpmnError has been found in: https://medium.com/@stephenrussett/throwing-bpmn-errors-with-javascript-in-camunda-c678f4b7d9ff.

But we always fail with

org.camunda.bpm.engine.ScriptCompilationException: Unable to compile script: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script42.groovy: 1: unable to resolve class org.camunda.bpm.engine.delegate.BpmnError
@ line 1, column 1.
import org.camunda.bpm.engine.delegate.BpmnError;
^

We have tried several different approaches but none of them succeeded:

  • We have commented in the pom file <scope>provided</scope> for org.camunda.bpm. This makes all jars to be included into our war file.
  • We have added in the pom file <manifestEntries> <Dependencies>org.camunda.bpm.camunda-engine</Dependencies> </manifestEntries> to create a dependency in manifest file.

What could be the reason we are failing?

We are running under Wildfly10 (standalone). Our pom file is pom.xml (2.2 KB). And our bpmn file is TimerTest.bpmn (12.0 KB)

Hi @alexeib,

How do you deploy your process models to the engine?

Cheers,
Thorben

We just put the war file into deployment folder on the server and it is autodeployed.

Could you publish a minimal example application that reproduces the error to github?

Thanks,
Thorben

@thorben a sample project can be found at github

If start a process Start Timer Test with Business Key TEST and Schedule 0 0/2 * * * ? then in Cockpit on Incedents tab there is an entry Unable to compile script …

During this samle I have also identified another issue that if I put a default value for a form filed and mark it as required I cannot submit a form without changes into the default value.

Hi @alexeib,

Thanks for providing the code which helped me debuggin the issue. This is indeed a bug in the Camunda Wildfly distribution, for which I raised a bug issue with some details here: https://app.camunda.com/jira/browse/CAM-8725.

You can work around that by adding the following dependency entry to the manifest of your application: org.codehaus.groovy.groovy-all services. The engine dependency is not required, as the Camunda subsystem adds this dependency implicitly during deployment.

Cheers,
Thorben

2 Likes

Hi,
for others experiencing this issue on Wildfly I managed to resolve this problem by making groovy global in standalone.xml. This solution is working when you are using rest deployment not only war deployment.

<global-modules> 
   <module name="org.codehaus.groovy.groovy-all"/>
   <module name="org.camunda.bpm.camunda-engine"/>
</global-modules>
...

Hope it helps someone

1 Like