{"record":{"id":"18e647015e6cd530","repo":"flowable/flowable-engine","slug":"no-resource-found-with-name-resourcename-in-de-18e647","errorCode":null,"errorMessage":"no resource found with name '<resourceName>' in deployment '<deploymentId>'","messagePattern":"no resource found with name '<resourceName>' in deployment '<deploymentId>'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":130,"sourceCode":"        // first try the cache\n        BpmnModel bpmnModel = bpmnModelCache.get(processDefinitionId);\n\n        if (bpmnModel == null) {\n            ProcessDefinition processDefinition = findDeployedProcessDefinitionById(processDefinitionId);\n            if (processDefinition == null) {\n                throw new ActivitiObjectNotFoundException(\"no deployed process definition found with id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n            }\n\n            // Fetch the resource\n            String resourceName = processDefinition.getResourceName();\n            ResourceEntity resource = Context.getCommandContext().getResourceEntityManager()\n                    .findResourceByDeploymentIdAndResourceName(processDefinition.getDeploymentId(), resourceName);\n            if (resource == null) {\n                if (Context.getCommandContext().getDeploymentEntityManager().findDeploymentById(processDefinition.getDeploymentId()) == null) {\n                    throw new ActivitiObjectNotFoundException(\"deployment for process definition does not exist: \"\n                            + processDefinition.getDeploymentId(), Deployment.class);\n                } else {\n                    throw new ActivitiObjectNotFoundException(\"no resource found with name '\" + resourceName\n                            + \"' in deployment '\" + processDefinition.getDeploymentId() + \"'\", InputStream.class);\n                }\n            }\n\n            // Convert the bpmn 2.0 xml to a bpmn model\n            BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();\n            bpmnModel = bpmnXMLConverter.convertToBpmnModel(new BytesStreamSource(resource.getBytes()), false, false);\n            bpmnModelCache.add(processDefinition.getId(), bpmnModel);\n        }\n        return bpmnModel;\n    }\n\n    public ProcessDefinition findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {\n        ProcessDefinition processDefinition = Context\n                .getCommandContext()\n                .getProcessDefinitionEntityManager()\n                .findLatestProcessDefinitionByKey(processDefinitionKey);\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java#L112-L148","documentation":"ActivitiObjectNotFoundException thrown by DeploymentManager.getBpmnModelById when the deployment exists but the BPMN XML resource with the definition's resourceName cannot be found in that deployment. The engine looks up the resource bytes (by deploymentId + resourceName) needed to parse the BpmnModel; a missing resource means the definition's model cannot be reconstructed.","triggerScenarios":"Calling getBpmnModelById(processDefinitionId) where findResourceByDeploymentIdAndResourceName returns null but the deployment row itself exists — i.e., ACT_GE_BYTEARRAY has no resource row matching the definition's resourceName in that deployment.","commonSituations":"Deployments created programmatically with resources added under different names than recorded on the definition, manual deletion of ACT_GE_BYTEARRAY rows, or copying definition rows between databases without the byte-array resources.","solutions":["Redeploy the BPMN XML so the resource is stored under the name recorded on the process definition","Check ACT_GE_BYTEARRAY for the resource bytes and restore missing rows from a backup","If resources were renamed, update the RESOURCE_NAME_ column on ACT_RE_PROCDEF to match the stored resource","Avoid manual manipulation of the deployment/resource tables; use the RepositoryService deployment builder"],"exampleFix":"// before (resource name mismatch on manual deploy)\nrepositoryService.createDeployment().addClasspathResource(\"process.bpmn20.xml\").deploy();\n// after (keep the same resource name the definition expects)\nrepositoryService.createDeployment().addClasspathResource(\"myProcess.bpmn20.xml\").deploy();","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult();\nif (pd != null && repositoryService.getResourceAsStream(pd.getDeploymentId(), pd.getResourceName()) == null) {\n    throw new IllegalStateException(\"Resource missing: \" + pd.getResourceName());\n}","typeGuard":null,"tryCatchPattern":"try {\n    return repositoryService.getBpmnModel(pdId);\n} catch (ActivitiObjectNotFoundException e) {\n    // redeploy or fall back to a locally parsed copy of the BPMN XML\n    return parseLocalBpmn(pdId);\n}","preventionTips":["Always deploy resources via the DeploymentBuilder so names are recorded consistently","Never manually prune ACT_GE_BYTEARRAY","Treat deployment + resources as an atomic unit"],"tags":["resource","deployment","bpmn","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}