Error with Spring Zeebe app: Duplicated process id in resources ‘do-nothing.bpmn’ and ‘do-nothing.bpmn’

Tony A: Hi folks,

We’re running into a problem deploying processes to zeebe, with Spring Zeebe starter 8.1.17 , Spring Boot 3 and Zeebe 8.1.7 (http://ghcr.io/camunda-community-hub/zeebe-with-hazelcast-exporter:8.1.7|ghcr.io/camunda-community-hub/zeebe-with-hazelcast-exporter:8.1.7)

When starting the application with java -jar app.jar the @Deployment of the processes fails with a duplicated process id, e.g.

...
Caused by: io.camunda.zeebe.client.api.command.ClientStatusException: Command 'CREATE' rejected with code 'INVALID_ARGUMENT': Expected to deploy new resources, but encountered the following errors:
Duplicated process id in resources 'do-nothing.bpmn' and 'do-nothing.bpmn'

However, running the main Spring boot application class from inside Intellij (for example), it all works fine.

Anybody run into anything like this? I’ve created a small application to reproduce here https://github.com/tjayr/zeebe-deployment-reproducer

Jack: (Disclaimer: I’m not with Camunda.)

The error seems to be caused by this @Deployment pattern:

"classpath*:**/*.bpmn"

spring-zeebe https://github.com/camunda-community-hub/spring-zeebe#deploy-process-models|uses Spring’s resource loader mechanism for those resource patterns. Spring, in turn, https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#resources-wildcards-in-path-other-stuff|warns that resource* patterns only work reliable when there’s one root directory before the pattern starts:
> Note that classpath*:, when combined with Ant-style patterns, only works reliably with at least one root directory before the pattern starts, unless the actual target files reside in the file system.
And seeing as the file is inside a jar…

When you place the bpmn file in resources/bpmn and change the pattern to:

classpath*:/bpmn/**/*.bpmn"

Everything seems to work fine.

Tony A: Oh much appreciated, thats a great spot. Imagine if I’d spent hours not seeing that…ugh :face_with_rolling_eyes:

Note: This post was generated by Slack Archivist from a conversation in the Camunda Platform 8 Slack, a source of valuable discussions on Camunda 8 (get an invite). Someone in the Slack thought this was worth sharing!

If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs.