{"record":{"id":"206aef49fcaf0d15","repo":"flowable/flowable-engine","slug":"exception-while-autodeploying-dmn-definitions-thi-206aef","errorCode":null,"errorMessage":"Exception while autodeploying DMN 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. ","messagePattern":"Exception while autodeploying DMN 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\\. ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/ResourceParentFolderAutoDeploymentStrategy.java","lineNumber":86,"sourceCode":"\n        for (final Entry<String, Set<Resource>> group : resourcesMap.entrySet()) {\n\n            final String deploymentName = determineDeploymentName(deploymentNameHint, group.getKey());\n            final DmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentName);\n\n            for (final Resource resource : group.getValue()) {\n                addResource(resource, deploymentBuilder);\n            }\n\n            try {\n\n                deploymentBuilder.deploy();\n\n            } catch (Exception e) {\n                if (isThrowExceptionOnDeploymentFailure()) {\n                    throw e;\n                } else {\n                    LOGGER.warn(\"Exception while autodeploying DMN definitions. \"\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. \", e);\n                }\n            }\n        }\n\n    }\n\n    private Map<String, Set<Resource>> createMap(final Resource[] resources) {\n        final Map<String, Set<Resource>> resourcesMap = new HashMap<>();\n\n        for (final Resource resource : resources) {\n            final String parentFolderName = determineGroupName(resource);\n            if (resourcesMap.get(parentFolderName) == null) {\n                resourcesMap.put(parentFolderName, new HashSet<>());\n            }\n            resourcesMap.get(parentFolderName).add(resource);\n        }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/ResourceParentFolderAutoDeploymentStrategy.java#L68-L104","documentation":"This is a logged warning (not a thrown exception) emitted when the DMN engine's ResourceParentFolderAutoDeploymentStrategy fails to deploy DMN resources during Spring application startup. Flowable deliberately swallows the exception unless 'flowable.dmn.deploy-resources' failure handling is set to throw, because concurrent server bootstraps can race on the same deployment and violate unique DB constraints, which is harmless (the other server's identical deployment wins). If the root cause is anything other than a unique constraint violation, deployment silently failed and definitions are missing.","triggerScenarios":"Calling deploymentBuilder.deploy() inside deployResourcesInternal throws (e.g. XML parse error, DB unique constraint on ACT_DMN_DEPLOYMENT, connection failure) while isThrowExceptionOnDeploymentFailure() is false (the default for Spring autodeployment).","commonSituations":"Multiple application instances starting simultaneously against a shared database and auto-deploying the same DMN resources; invalid .dmn XML files on the classpath; database connection issues during startup.","solutions":["Inspect the 'e' stack trace attached to this warning: if it is a unique constraint violation, no action is needed; if it is anything else, fix the root cause (bad DMN XML, DB connectivity).","Ensure only one node performs autodeployment at a time, or pre-deploy DMN resources and disable autodeployment (flowable.dmn.deploy-resources=false).","Set the deployment mode / use deploymentName with 'deployment-mode: default' semantics or enable 'flowable.check-deployment-desc-version'-style checks so identical deployments are deduplicated.","If failures must fail startup, set throwExceptionOnDeploymentFailure=true on the DmnEngineConfiguration so the original exception propagates."],"exampleFix":"// before (application.yml)\nflowable:\n  dmn:\n    deploy-resources: true\n// after: pre-deploy and disable autodeploy on multi-node clusters\nflowable:\n  dmn:\n    deploy-resources: false\n// or fail fast instead of swallowing:\n// dmnEngineConfiguration.setThrowExceptionOnDeploymentFailure(true);","handlingStrategy":"try-catch","validationCode":"// verify DB reachable and definitions unique before enabling autodeploy\ntry (Connection c = dataSource.getConnection()) {\n  if (!c.isValid(5)) throw new IllegalStateException(\"DB unreachable at startup\");\n}\n// and verify .dmn XML well-formedness\nXMLInputFactory f = XMLInputFactory.newInstance();\nf.createXMLStreamReader(new FileInputStream(\"rules.dmn\")).close();","typeGuard":null,"tryCatchPattern":"// wrap engine autodeploy/startup yourself if you must react\ntry {\n  dmnEngineConfiguration.deployResources();\n} catch (org.flowable.common.engine.api.FlowableException e) {\n  if (!isUniqueConstraintViolation(e)) {\n    throw e; // fail startup on real errors; only constraint races are safe\n  }\n  log.warn(\"Concurrent autodeploy race, ignoring\", e);\n}","preventionTips":["Check the root-cause exception in the warning; only unique constraint violations are safe to ignore","On multi-node clusters, disable autodeployment and deploy DMN resources once via a controlled step","Set throwExceptionOnDeploymentFailure=true in environments where silent deployment loss is unacceptable","Validate .dmn resources (XSD) in CI so bad XML never reaches startup"],"tags":["flowable","dmn","autodeployment","spring","concurrency","database"],"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-14T05:17:10.506Z"}