flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find a resource with name
Error message
Could not find a resource with name '${resourceName}' in deployment '${deploymentId}'. What it means
If the requested resourceName is not present in the given deployment (checked via repositoryService.getResourceAsStream returning null / resource list), FlowableObjectNotFoundException is thrown with the resource name and deployment id embedded. The deployment exists but does not contain a resource with that exact name.
Solutions
- List actual resources with GET /repository/deployments/{deploymentId}/resources and copy the exact name.
- Include the correct path prefix (e.g. 'bpmn/my-process.bpmn20.xml') exactly as listed.
- Confirm the resource belongs to this deployment id, not another one.
- Handle HTTP 404 by falling back to the resource listing endpoint.
Example fix
// before GET /repository/deployments/2501/resourcedata/process.bpmn20.xml // after GET /repository/deployments/2501/resourcedata/bpmn/process.bpmn20.xml // full name from resources list
Defensive patterns
Strategy: validation
Validate before calling
const res = (await get(`/repository/deployments/${deploymentId}/resources`)).data;
const entry = res.data.find(r => r.url.endsWith('/' + encodeURIComponent(resourceName)) || r.id === resourceName);
if (!entry) throw new Error(`Resource ${resourceName} not in deployment ${deploymentId}`); Try / catch
try { return await getResourceData(deploymentId, name); }
catch (e) { if (e.status === 404) return listResources(deploymentId); throw e; } Prevention
- Always look up the exact resource id/name from the deployment's resources endpoint first.
- Remember resource names include folder prefixes (e.g. 'bpmn/').
- Match names exactly, including case.
When it happens
Trigger: GET /repository/deployments/{deploymentId}/resourcedata/{resourceName} where the resource name doesn't match any entry in the deployment (wrong name, wrong path prefix like 'bpmn/', or resource belongs to a different deployment).
Common situations: Guessing resource names instead of listing them (names include folder prefixes); requesting a resource from a different deployment; case-sensitive mismatch on some databases.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Could not find a deployment with id
- Could not find a deployment with id
- Could not find a deployment with id
- Could not find a deployment with id
- Could not find a deployment with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/83aa92a5c55329fc.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/BaseDeploymentResourceDataResource.java:78
if (restApiInterceptor != null) {
restApiInterceptor.accessDeploymentById(deployment);
}
List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
if (resourceList.contains(resourceName)) {
String contentType = contentTypeResolver.resolveContentType(resourceName);
response.setContentType(contentType);
try (final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceName)) {
return IOUtils.toByteArray(resourceStream);
} catch (Exception e) {
throw new FlowableException("Error converting resource stream", e);
}
} else {
// Resource not found in deployment
throw new FlowableObjectNotFoundException("Could not find a resource with name '" + resourceName + "' in deployment '" + deploymentId + "'.", String.class);
}
}
}
View on GitHub (pinned to d6d39ce1c6)