flowable/flowable-engine · error · FlowableObjectNotFoundException

deployment does not exist:

Error message

deployment does not exist: 

What it means

After the null checks, the command queries the resource by deploymentId and resourceName. If no resource row is found AND the deployment itself does not exist, it throws FlowableObjectNotFoundException 'deployment does not exist: <id>'. This distinguishes a bad deployment id from a bad resource name.

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/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");
        }

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

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the id is an EVENT deployment id via EventRepositoryService.createDeploymentQuery().deploymentId(id).singleResult()
  2. Redeploy the event deployment if it was deleted
  3. Point the call at the correct engine/service for the deployment type

Example fix

// before
InputStream is = getDeploymentResource(processDeploymentId, "order.event.json"); // wrong engine's id
// after
EventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentId(eventDeploymentId).singleResult();
if (dep == null) throw new FlowableObjectNotFoundException("Unknown event deployment " + eventDeploymentId);
InputStream is = getDeploymentResource(eventDeploymentId, "order.event.json");
Defensive patterns

Strategy: try-catch

Validate before calling

EventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (dep == null) throw new IllegalArgumentException("Unknown event deployment: " + deploymentId);

Type guard

boolean deploymentExists = eventRepositoryService.createDeploymentQuery().deploymentId(id).singleResult() != null;

Try / catch

try {
    return getDeploymentResource(deploymentId, resourceName);
} catch (FlowableObjectNotFoundException e) {
    if (e.getMessage().startsWith("deployment does not exist")) {
        throw new IllegalStateException("Stale deployment id: " + deploymentId, e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Executing GetDeploymentResourceCmd with a deploymentId that was never deployed, was deleted, or belongs to a different engine (e.g. process deployment id used against the event-registry engine).

Common situations: Using a BPMN/process deployment id with the event registry service; deployment removed by cascade delete or cleanup job; hard-coded id from another environment (test vs prod database).

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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