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
DefaultAutoDeploymentStrategy.deployResourcesInternal builds a CMMN deployment and calls deploymentBuilder.deploy(). If that throws a RuntimeException and isThrowExceptionOnDeploymentFailure() is false, the exception is swallowed with this warning; if true, it is rethrown. It exists so concurrent server startups hitting a unique-constraint on the same auto-deployment do not crash every node.
Source
Thrown at modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/DefaultAutoDeploymentStrategy.java:72
protected void deployResourcesInternal(String deploymentNameHint, Resource[] resources, CmmnEngine engine) {
CmmnRepositoryService repositoryService = engine.getCmmnRepositoryService();
// Create a single deployment for all resources using the name hint as the literal name
final CmmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentNameHint);
for (final Resource resource : resources) {
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);
}
}
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Read the wrapped root cause in the log to see the actual failure (unique constraint vs XML parse error).
- If you want failures to surface, set cmmn.deployment.throwExceptionOnDeploymentFailure (CmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure) to true.
- Serialize/avoid concurrent auto-deploys: deploy once during image build or use shared deployment (deploymentMode: single-resource/startup with tenant checks).
- If it is the unique-constraint race, it is benign — the other node's deployment wins; verify definitions are present in ACT_CMMN_DEPLOYMENT.
- Fix the invalid CMMN resource if the cause is schema/validation failure.
Example fix
// before
@Bean
public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> config() { ... } // silent swallow
cmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(false);
// after
cmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(true); // fail fast on bad deployments Defensive patterns
Strategy: retry
Validate before calling
// pre-flight: ensure only one node auto-deploys or definitions already exist
long count = managementService.executeCommand(ctx ->
ctx.getProcessEngineConfiguration().getDeploymentEntityManager()
.findDeploymentsByQueryCriteria(new DeploymentQueryImpl().deploymentName(deploymentName))).size();
if (count > 0) { /* skip auto-deploy */ } Try / catch
try {
cmmnEngine.run();
} catch (FlowableException e) {
if (e.getCause() instanceof SQLException && e.getMessage().contains("unique")) {
LOGGER.info("Concurrent auto-deploy detected; continuing");
} else {
throw e;
}
} Prevention
- Set throwExceptionOnDeploymentFailure=true unless you explicitly need cluster-race tolerance.
- Stagger instance startup or use leader election so one node deploys.
- Use Flowable's deployment deduplication features (same-deployment auto-deploy modes).
- Always log the full exception chain to distinguish constraint races from real errors.
When it happens
Trigger: Spring boot auto-deployment of CMMN resources (default strategy) when the database insert fails — most often a unique constraint (ACT_CMMN_DEPLOYMENT) violation from two nodes deploying identical resources simultaneously, or invalid CMMN XML.
Common situations: Multiple application instances starting simultaneously against a shared Flowable database; a restart racing with a previous deployment; malformed .cmmn/.cmmn10.xml resources when throwExceptionOnDeploymentFailure is false (error hidden in logs).
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/5fd14df3173616af.
Report an issue: GitHub.