flowable/flowable-engine · error · FlowableObjectNotFoundException

deployment does not exist:

Error message

deployment does not exist: 

What it means

After the resource lookup returns null, this command checks whether the deployment itself exists. If findById(deploymentId) is null, it throws FlowableObjectNotFoundException indicating the deploymentId references no deployed CMMN deployment. The exception carries CmmnDeploymentEntity.class as the missing type.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetDeploymentResourceCmd.java:52

    public GetDeploymentResourceCmd(String deploymentId, String resourceName) {
        this.deploymentId = deploymentId;
        this.resourceName = resourceName;
    }

    @Override
    public InputStream execute(CommandContext commandContext) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("deploymentId is null");
        }
        if (resourceName == null) {
            throw new FlowableIllegalArgumentException("resourceName is null");
        }

        CmmnResourceEntity resource = CommandContextUtil.getCmmnResourceEntityManager(commandContext)
                .findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
        if (resource == null) {
            if (CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(deploymentId) == null) {
                throw new FlowableObjectNotFoundException("deployment does not exist: " + deploymentId, CmmnDeploymentEntity.class);
            } else {
                throw new FlowableObjectNotFoundException("no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", CmmnResourceEntity.class);
            }
        }
        return new ByteArrayInputStream(resource.getBytes());
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the deploymentId exists via cmmnRepositoryService.createDeploymentQuery().deploymentId(id).singleResult() before fetching the resource
  2. List deployments with createDeploymentQuery().list() and use a valid id
  3. Fix cross-environment id confusion (test vs prod database)

Example fix

// before
InputStream is = cmmnRepositoryService.getResource("42", "case.cmmn"); // id does not exist
// after
CmmnDeployment d = cmmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (d != null) {
    InputStream is = cmmnRepositoryService.getResource(deploymentId, "case.cmmn");
}
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = cmmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;

Try / catch

try { return cmmnRepositoryService.getResource(deploymentId, name); } catch (FlowableObjectNotFoundException e) { if (e.getCauseClass() != null) log.warn("Deployment {} not found", deploymentId); return null; }

Prevention

When it happens

Trigger: Calling CmmnRepositoryService.getResource(deploymentId, resourceName) with a deploymentId that does not exist in ACT_CMMN_DEPLOYMENT (e.g. an arbitrary or already-cleaned-up id), with both arguments non-null.

Common situations: Using a process (BPMN) deployment id against the CMMN repository service; stale ids after database recreation or deployment cleanup; hardcoded ids from another environment.

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