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

getDeploymentResourceData first loads the deployment's resource list and checks whether resourceName is present. If the deployment exists but contains no resource with the exact given name, it throws FlowableObjectNotFoundException ('Could not find a resource with name ... in deployment ...', String.class), producing HTTP 404.

Solutions

  1. List the deployment's resources via GET /cmmn-repository/deployments/{deploymentId}/resources and use the exact 'id'/'url' name shown there.
  2. Match case and full path exactly as stored (the name includes any folder prefix).
  3. URL-encode the resource name when it contains slashes or spaces.
  4. Verify the resource was part of this specific deployment, not another one.

Example fix

// before
GET /cmmn-repository/deployments/9f01/res/OrderProcess.cmmn.xml   // stored as 'diagrams/OrderProcess.cmmn.xml'
// after
GET /cmmn-repository/deployments/9f01/resources                   // list
GET /cmmn-repository/deployments/9f01/res/diagrams%2FOrderProcess.cmmn.xml
Defensive patterns

Strategy: validation

Validate before calling

async function resolveResourceName(deploymentId, wantedName) {
  const res = await get(`/cmmn-repository/deployments/${deploymentId}/resources`);
  const names = res.data.map(r => r.id);
  if (!names.includes(wantedName)) {
    throw new Error(`Resource '${wantedName}' not in deployment. Available: ${names.join(', ')}`);
  }
  return wantedName;
}

Try / catch

try {
  return await fetchResourceData(deploymentId, name);
} catch (e) {
  if (e.response?.status === 404 && /resource with name/.test(e.response.data?.message)) {
    const list = await get(`/cmmn-repository/deployments/${deploymentId}/resources`);
    throw new Error(`Use exact name. Available: ${list.data.map(r => r.id)}`);
  }
  throw e;
}

Prevention

When it happens

Trigger: GET /cmmn-repository/deployments/{deploymentId}/res/{resourceName} where resourceName differs from the stored resource name (wrong case, wrong path prefix like 'src/main/resources/...', unencoded characters, or resource belongs to a different deployment).

Common situations: Assuming the resource name equals the original file name while the engine stores it under a deployment-relative path; case-sensitive matching on Linux; guessing the name instead of listing resources first.

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/fad531c80bc5bc29. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseDeploymentResourceDataResource.java:79

            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)