flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a resource with id

Error message

Could not find a resource with id '<resourceId>' in deployment '<deploymentId>

What it means

After loading the deployment, the code lists deployment resources and only proceeds to stream if the requested resourceId is among them; otherwise FlowableObjectNotFoundException("Could not find a resource with id '<resourceId>' in deployment '<deploymentId>'") is thrown. The deployment exists but contains no resource with that id.

Solutions

  1. List the deployment's resources with GET /dmn-repository/deployments/{deploymentId}/resources and use an id from the response.
  2. If you only have the resource name, use the resource-data-by-name endpoint (BaseDmnDeploymentResourceDataResource) instead.
  3. Refresh cached resource ids after any redeploy; ids change with new deployments.

Example fix

// before
byte[] dmn = client.getDeploymentResourceData(deploymentId, "my.dmn"); // that's a name, not an id
// after
ResourceResponse resource = client.getDeploymentResources(deploymentId).stream()
    .filter(r -> r.getName().equals("my.dmn")).findFirst().orElseThrow();
byte[] dmn = client.getDeploymentResourceData(deploymentId, resource.getId());
Defensive patterns

Strategy: validation

Validate before calling

Set<String> ids = getDeploymentResources(deploymentId).stream()
    .map(ResourceResponse::getId).collect(toSet());
if (!ids.contains(resourceId)) throw new IllegalArgumentException(resourceId + " not in deployment " + deploymentId);

Try / catch

try {
    byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);
} catch (FlowableObjectNotFoundException e) {
    resourceId = lookupResourceIdByName(deploymentId, expectedName);
}

Prevention

When it happens

Trigger: GET /dmn-repository/deployments/{deploymentId}/resources/{resourceId} where resourceId is not a resource of that deployment: id copied from another deployment, guessed/truncated id, or a resource name used where an id is required.

Common situations: Mixing up resource id and resource name (this endpoint needs the id; BaseDmnDeploymentResourceDataResource takes the name); stale cached resource ids after redeployment; typos in hard-coded ids.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/187fd022e828c9c6. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDecisionResource.java:103

        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

        List<String> resourceList = dmnRepositoryService.getDeploymentResourceNames(deploymentId);

        if (resourceList.contains(resourceId)) {
            String contentType = contentTypeResolver.resolveContentType(resourceId);
            response.setContentType(contentType);
            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceId)) {
                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 id '" + resourceId + "' in deployment '" + deploymentId);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)