{"record":{"id":"55e47d4440def842","repo":"flowable/flowable-engine","slug":"exception-while-autodeploying-cmmn-definitions-for","errorCode":null,"errorMessage":"Exception while autodeploying CMMN definitions for resource {}. 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. ","messagePattern":"Exception while autodeploying CMMN definitions for resource (.+?)\\. 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\\. ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java","lineNumber":72,"sourceCode":"        CmmnRepositoryService repositoryService = engine.getCmmnRepositoryService();\n\n        // Create a separate deployment for each resource using the resource name\n\n        for (final Resource resource : resources) {\n\n            final String resourceName = determineResourceName(resource);\n            final CmmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);\n\n            addResource(resource, resourceName, deploymentBuilder);\n            try {\n\n                deploymentBuilder.deploy();\n\n            } catch (RuntimeException e) {\n                if (isThrowExceptionOnDeploymentFailure()) {\n                    throw e;\n                } else {\n                    LOGGER.warn(\"Exception while autodeploying CMMN definitions for resource {}. \"\n                        + \"This exception can be ignored if the root cause indicates a unique constraint violation, \"\n                        + \"which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. \", resource, e);\n                }\n            }\n        }\n    }\n\n}\n","sourceCodeStart":54,"sourceCodeEnd":81,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java#L54-L81","documentation":"SingleResourceAutoDeploymentStrategy deploys each CMMN resource as its own deployment; when deploymentBuilder.deploy() throws a RuntimeException and throwExceptionOnDeploymentFailure is false, the exception is logged with the offending resource name and swallowed. This lets clustered startups continue when a unique constraint is hit by another node deploying the same resource.","triggerScenarios":"Per-resource Spring auto-deployment of a .cmmn/.dmn-style resource failing in deploy(): unique constraint race between simultaneous server boots, or an invalid/unreadable resource being deployed.","commonSituations":"Multiple app instances sharing one Flowable DB booting in the same instant; one corrupt .cmmn file among many silently skipped; deployments racing with a concurrent redeploy of identical content.","solutions":["Check the log line for the resource name ({}) and its root cause; unique-constraint races are safe to ignore.","Enable CmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(true) so failures fail startup instead of being warned.","Remove or fix the invalid resource if the cause is XML/validation, since it is silently skipped otherwise.","Add a startup lock or designate a single deployer node to avoid multi-node simultaneous auto-deploy.","Verify each case definition appears in the repository after boot to confirm nothing was lost."],"exampleFix":"// before\ncmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(false);\n// after\ncmmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(true); // treat per-resource deploy failure as fatal","handlingStrategy":"retry","validationCode":"for (String res : resources) {\n    // validate resource parses before deploy\n    try (InputStream is = new FileInputStream(res)) {\n        DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is); // throws early on malformed XML\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    deployResources(resources);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof SQLIntegrityConstraintViolationException\n        || String.valueOf(e).contains(\"ACT_CMMN_DEPLOYMENT\")) {\n        LOGGER.info(\"Benign concurrent deployment for resource; skipping\");\n    } else throw e;\n}","preventionTips":["Set throwExceptionOnDeploymentFailure=true to surface bad resources at startup.","Verify post-boot that each expected case definition is registered (createCaseDefinitionQuery).","Fix or remove corrupt .cmmn resources; per-resource mode silently skips failures otherwise.","Coordinate multi-node boots (stagger or single deployer) to avoid unique-constraint races."],"tags":["auto-deployment","database","concurrency","cmmn"],"backgroundTag":"database-write-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}