{"record":{"id":"8529087935f13d66","repo":"flowable/flowable-engine","slug":"could-not-find-a-resource-with-id-resourcename-852908","errorCode":null,"errorMessage":"Could not find a resource with id '${resourceName}' in deployment '${deploymentId}'.","messagePattern":"Could not find a resource with id '(.+?)' in deployment '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentResourceResource.java","lineNumber":89,"sourceCode":"\n        // Check if deployment exists\n        CmmnDeployment deployment = getCmmnDeployment(deploymentId);\n\n        String pathInfo = request.getPathInfo();\n        String resourceName = pathInfo.replace(\"/cmmn-repository/deployments/\" + deployment.getId() + \"/resources/\", \"\");\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deployment.getId());\n\n        if (resourceList.contains(resourceName)) {\n            // Build resource representation\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n\n            DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName, contentType);\n            return response;\n\n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with id '\" + resourceName + \"' in deployment '\" + deploymentId + \"'.\");\n        }\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentResourceResource.java#L71-L93","documentation":"The deployment-resource endpoint looks up a resource by name inside a deployment's resource list. If no resource with the given id/name exists in the specified deployment, it throws FlowableObjectNotFoundException. Note the id is the resource NAME (e.g. 'case.cmmn.xml'), not a numeric resource id.","triggerScenarios":"GET /cmmn-query/repository/deployments/{deploymentId}/resources/{resourceName} where resourceName does not match any resource deployed under that deploymentId (typo, wrong deployment, or passing a numeric id instead of the resource name).","commonSituations":"Copy-pasting deployment ids across environments, assuming resource ids are integers, redeploying a corrected case under a new deployment id and querying the old one, or URL-encoding issues dropping the .xml extension.","solutions":["GET /repository/deployments/{deploymentId}/resources first and use an exact resource name from that list.","Verify the deploymentId is correct for the environment you are querying.","URL-encode special characters in resourceName so the full name (including .cmmn.xml) reaches the handler.","Catch FlowableObjectNotFoundException and treat it as 404 in client code."],"exampleFix":"// before\nget('/repository/deployments/12345/resources/17'); // numeric id\n\n// after\nget('/repository/deployments/12345/resources/case.cmmn.xml'); // resource name","handlingStrategy":"try-catch","validationCode":"const resources = await get(`/repository/deployments/${deploymentId}/resources`);\nif (!resources.some(r => r.id === resourceName)) throw new Error('resource not in deployment');","typeGuard":null,"tryCatchPattern":"try {\n  return getResource(deploymentId, resourceName);\n} catch (FlowableObjectNotFoundException e) {\n  throw new NotFoundException(\"Deployment resource not found: \" + resourceName);\n}","preventionTips":["List resources for the deployment and use the exact name from the response.","Remember resource ids are names like 'case.cmmn.xml', not numbers.","URL-encode resource names in the path."],"tags":["rest-api","resource-not-found","deployment","flowable"],"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-14T05:17:10.506Z"}