{"record":{"id":"6992e5be9ce15c81","repo":"flowable/flowable-engine","slug":"no-resource-found-with-name-in-deployment-6992e5","errorCode":null,"errorMessage":"no resource found with name '' in deployment ''","messagePattern":"no resource found with name '' in deployment ''","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceCmd.java","lineNumber":54,"sourceCode":"        this.deploymentId = deploymentId;\n        this.resourceName = resourceName;\n    }\n\n    @Override\n    public InputStream execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n\n        EventResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);\n        if (resource == null) {\n            if (CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId) == null) {\n                throw new FlowableObjectNotFoundException(\"deployment does not exist: \" + deploymentId);\n            } else {\n                throw new FlowableObjectNotFoundException(\"no resource found with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'\");\n            }\n        }\n        return new ByteArrayInputStream(resource.getBytes());\n    }\n\n}\n","sourceCodeStart":36,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceCmd.java#L36-L61","documentation":"The resource query returned nothing but the deployment itself exists, so the command throws FlowableObjectNotFoundException 'no resource found with name <resourceName> in deployment <deploymentId>'. The deployment is real; the requested resource name simply is not part of it.","triggerScenarios":"Executing GetDeploymentResourceCmd(deploymentId, wrongName) where the name differs in case, extension, or path from what was deployed (e.g. 'Model.json' vs 'model.json').","commonSituations":"Typo in resource name; renamed resource after an engine version upgrade; assuming resources are auto-generated names instead of the exact deployed filenames; case-sensitive DB collation differences.","solutions":["List actual resource names via EventRepositoryService.getDeploymentResourceNames(deploymentId) and use one exactly","Correct the resource name spelling/case/extension","Redeploy including the missing resource file"],"exampleFix":"// before\nInputStream is = getResource(deploymentId, \"OrderEvent.json\");\n// after\nList<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId);\nString exact = names.stream().filter(n -> n.equalsIgnoreCase(\"OrderEvent.json\")).findFirst()\n    .orElseThrow(() -> new FlowableObjectNotFoundException(\"resource missing\"));\nInputStream is = getResource(deploymentId, exact);","handlingStrategy":"fallback","validationCode":"List<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId);\nif (!names.contains(resourceName)) throw new IllegalArgumentException(\"Resource \" + resourceName + \" not in deployment\");","typeGuard":"boolean resourceInDeployment = eventRepositoryService.getDeploymentResourceNames(deploymentId).stream().anyMatch(n -> n.equals(resourceName));","tryCatchPattern":"try {\n    return getDeploymentResource(deploymentId, resourceName);\n} catch (FlowableObjectNotFoundException e) {\n    // fallback to first available resource or rethrow\n    List<String> names = eventRepositoryService.getDeploymentResourceNames(deploymentId);\n    if (!names.isEmpty()) return getDeploymentResource(deploymentId, names.get(0));\n    throw e;\n}","preventionTips":["Use getDeploymentResourceNames to confirm exact names first","Beware case-sensitive resource name matching","Redeploy when resource files are renamed"],"tags":["flowable","event-registry","not-found","resource"],"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-14T11:17:12.474Z"}