{"record":{"id":"23d9a5c48222d081","repo":"flowable/flowable-engine","slug":"could-not-find-a-resource-with-name-resourcenam-23d9a5","errorCode":null,"errorMessage":"Could not find a resource with name '${resourceName}' in deployment '${deploymentId}'.","messagePattern":"Could not find a resource with name '(.+?)' in deployment '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseDeploymentResourceDataResource.java","lineNumber":78,"sourceCode":"        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceName)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n            response.setContentType(contentType);\n            \n            try (final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceName)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'.\", String.class);\n        }\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":82,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseDeploymentResourceDataResource.java#L60-L82","documentation":"FlowableObjectNotFoundException thrown when the deployment exists but contains no resource with the requested name. The resource existence check against the deployment's resource list failed before any stream was opened.","triggerScenarios":"Requesting a resource name that was not part of the deployment, misspelled resource file names, or requesting resources of a deployment that shipped a different set of files.","commonSituations":"Assuming a standard resource name (e.g. 'my-event.json') that was actually deployed under a different path, case-sensitivity mismatches, or fetching from the wrong deployment version.","solutions":["List the deployment's resources via GET /event-registry-repository/deployments/{deploymentId}/resources and use an exact name from that list.","Match case and path exactly; resource names include the full path as deployed.","Point at the correct deployment version that actually contains the resource."],"exampleFix":"// before\nString name = \"events/order-event.json\"; // deployed as 'order-event.json'\n// after\nList<EventResource> res = repositoryService.getDeploymentResources(deploymentId);\nString name = res.stream().map(EventResource::getName).filter(n -> n.endsWith(\"order-event.json\")).findFirst().get();","handlingStrategy":"validation","validationCode":"boolean exists = repositoryService.getDeploymentResources(deploymentId).stream().anyMatch(r -> r.getName().equals(resourceName));","typeGuard":null,"tryCatchPattern":"try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).body(\"resource not in deployment\"); }","preventionTips":["Always list resources for the deployment before fetching data","Match resource names case- and path-exactly"],"tags":["rest-api","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-18T16:17:23.245Z"}