{"record":{"id":"58ac6ebdeeeeba82","repo":"flowable/flowable-engine","slug":"exception-while-autodeploying-dmn-definitions-for","errorCode":null,"errorMessage":"Exception while autodeploying DMN 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 DMN 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-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java","lineNumber":72,"sourceCode":"        DmnRepositoryService repositoryService = engine.getDmnRepositoryService();\n\n        // Create a separate deployment for each resource using the resource name\n\n        for (Resource resource : resources) {\n\n            final String resourceName = determineResourceName(resource);\n            final DmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);\n            addResource(resource, resourceName, deploymentBuilder);\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 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-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java#L54-L81","documentation":"Same family as the parent-folder strategy warning, but logged by SingleResourceAutoDeploymentStrategy, which deploys each DMN resource as its own deployment. When deploymentBuilder.deploy() throws for one specific resource, this warning names that resource and swallows the exception unless throwExceptionOnDeploymentFailure is enabled. Only unique-constraint root causes (concurrent boot race) are considered safe to ignore; other causes mean that resource's DMN definitions were not deployed.","triggerScenarios":"deployResourcesInternal iterates Spring resources; deploymentBuilder.deploy() throws for a single resource (malformed .dmn XML, unique constraint race between two servers, DB error) while isThrowExceptionOnDeploymentFailure() is false.","commonSituations":"Clustering: two pods boot at the same instant and both deploy the same single .dmn file; a single broken .dmn file in the resources folder; database temporarily unavailable at startup.","solutions":["Read the attached exception to identify which resource failed and why; ignore only if it is a unique constraint violation.","Fix or remove the offending .dmn resource identified by the {} placeholder in the message.","On clusters, serialize autodeployment (external deployment step) or set flowable.dmn.deploy-resources=false.","Set throwExceptionOnDeploymentFailure=true to make startup fail loudly on real deployment errors."],"exampleFix":"// before\nclasspath: rules/invoice-lookup.dmn   // malformed XML, silently skipped\n// after\n# validate the file, or disable autodeploy in favor of a controlled deploy step\nflowable.dmn.deploy-resources=false","handlingStrategy":"try-catch","validationCode":"// per-resource pre-check before enabling autodeploy\nXMLStreamReader r = XMLInputFactory.newInstance()\n    .createXMLStreamReader(new FileInputStream(resource.getFile()));\nwhile (r.hasNext()) r.next(); // throws XMLStreamException if malformed\nr.close();","typeGuard":null,"tryCatchPattern":"try {\n  deploymentBuilder.deploy();\n} catch (org.flowable.common.engine.api.FlowableException e) {\n  if (!isUniqueConstraintViolation(e)) throw e;\n  log.warn(\"Deployment race for {}, ignoring\", resourceName, e);\n}","preventionTips":["Identify the failing resource from the {} placeholder and inspect its attached stack trace","Validate every .dmn file in the resources folder in CI before packaging","Serialize deployments across cluster nodes (init job / leader election) to avoid unique-constraint races","Enable throwExceptionOnDeploymentFailure for strict environments"],"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"}