flowable/flowable-engine · warning
Exception while autodeploying CMMN definitions. This excepti
Error message
Exception while autodeploying CMMN definitions. This exception can be ignored if the root cause indicates a unique constraint violation, which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions.
What it means
ResourceParentFolderAutoDeploymentStrategy deploys all CMMN resources under a common parent folder in one deployment; if deploymentBuilder.deploy() throws and throwExceptionOnDeploymentFailure is false, the RuntimeException is logged with this warning and swallowed. Same purpose as the other auto-deploy strategies: tolerate unique-constraint races during clustered startup.
Source
Thrown at modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/ResourceParentFolderAutoDeploymentStrategy.java:84
// Create a deployment for each distinct parent folder using the name hint as a prefix
final Map<String, Set<Resource>> resourcesMap = createMap(resources);
for (final Entry<String, Set<Resource>> group : resourcesMap.entrySet()) {
final String deploymentName = determineDeploymentName(deploymentNameHint, group.getKey());
final CmmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentName);
for (final Resource resource : group.getValue()) {
addResource(resource, deploymentBuilder);
}
try {
deploymentBuilder.deploy();
} catch (RuntimeException e) {
if (isThrowExceptionOnDeploymentFailure()) {
throw e;
} else {
LOGGER.warn("Exception while autodeploying CMMN definitions. "
+ "This exception can be ignored if the root cause indicates a unique constraint violation, "
+ "which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. ", e);
}
}
}
}
private Map<String, Set<Resource>> createMap(final Resource[] resources) {
final Map<String, Set<Resource>> resourcesMap = new HashMap<>();
for (final Resource resource : resources) {
final String parentFolderName = determineGroupName(resource);
if (resourcesMap.get(parentFolderName) == null) {
resourcesMap.put(parentFolderName, new HashSet<>());
}
resourcesMap.get(parentFolderName).add(resource);
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Inspect the logged root cause to distinguish benign unique-constraint races from real deployment errors.
- Set throwExceptionOnDeploymentFailure=true on CmmnEngineConfiguration to rethrow instead of warn.
- Use Flowable's deployment deduplication (same-deployment-name/lock) or ensure only one node performs auto-deployment.
- Confirm case definitions exist after startup; if only the constraint fired, the definitions were deployed by the other instance.
- Validate CMMN resources offline (e.g. with the CMMN XSD) if the cause is model validation.
Example fix
// before cmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(false); // after cmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(true); // propagate deploy() RuntimeExceptions
Defensive patterns
Strategy: retry
Validate before calling
// pre-flight: check whether the parent-folder deployment already exists
boolean deployed = repositoryService.createDeploymentQuery()
.deploymentName(parentFolderDeploymentName).count() > 0;
if (deployed) { /* skip redeployment */ } Try / catch
try {
applicationContext.publishEvent(new ApplicationReadyEvent(...)); // trigger deploy
} catch (RuntimeException e) {
if (isUniqueConstraintViolation(e)) { LOGGER.info("Another node deployed first; ok"); }
else throw e;
} Prevention
- Enable throwExceptionOnDeploymentFailure for fail-fast behavior.
- Deploy resources in a dedicated single-node phase of your rollout.
- Keep parent-folder resources identical across nodes so constraint races stay benign.
- Validate CMMN XML against the XSD in CI before bundling.
When it happens
Trigger: Spring auto-deployment where all resources share one parent folder (single deployment) and the deploy() call fails — unique constraint from two servers booting at once, duplicate deployment name, or invalid CMMN model.
Common situations: Clustered microservices sharing a Flowable DB starting simultaneously; repeated deployment of identical resources without deployResources deduplication; invalid .cmmn files bundled in a folder being auto-deployed.
Related errors
- Exception while autodeploying CMMN definitions. This excepti
- Exception while autodeploying CMMN definitions for resource
- Exception while autodeploying DMN definitions. This exceptio
- Task '
- Can only enable a plan item instance which is in state ENABL
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/385767c731871717.
Report an issue: GitHub.