flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a channel definition with id

Error message

Could not find a channel definition with id '${channelDefinitionId}'.

What it means

FlowableObjectNotFoundException thrown by ChannelDefinitionResourceDataResource.getChannelDefinitionFromRequest when the channel definition query (createChannelDefinitionQuery().channelDefinitionId(id).singleResult()) returns null. The id provided for a channel-definition resource-data request does not match any deployed channel definition.

Solutions

  1. Fetch valid ids from the channel-definitions collection endpoint first.
  2. Check the datasource/tenant configuration so the query runs against the right database.
  3. Redeploy the channel definition if the target environment never received it.

Example fix

// before
ChannelDefinition cd = repoService.createChannelDefinitionQuery().channelDefinitionId(id).singleResult();
// after
ChannelDefinition cd = repoService.createChannelDefinitionQuery().channelDefinitionId(id).singleResult();
if (cd == null) throw new ResponseStatusException(NOT_FOUND, "unknown channelDefinitionId " + id); // validate before deep calls
Defensive patterns

Strategy: try-catch

Validate before calling

boolean exists = repositoryService.createChannelDefinitionQuery().channelDefinitionId(id).count() > 0;

Try / catch

try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).build(); }

Prevention

When it happens

Trigger: GET /event-registry-repository/repository/channel-definitions/{channelDefinitionId}/resource (or model/xml resource endpoints) with a nonexistent id.

Common situations: Ids from a previous deployment version, ids copied from a different database/environment, or typos in manually constructed URLs.

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

Appendix: source

Thrown at modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/ChannelDefinitionResourceDataResource.java:56

    @ApiOperation(value = "Get a channel definition resource content", tags = { "Channel Definitions" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates both channel definition and resource have been found and the resource data has been returned."),
            @ApiResponse(code = 404, message = "Indicates the requested channel definition was not found or there is no resource with the given id present in the channel definition. The status-description contains additional information.")
    })
    @GetMapping(value = "/event-registry-repository/channel-definitions/{channelDefinitionId}/resourcedata")
    public byte[] getChannelDefinitionResource(@ApiParam(name = "channelDefinitionId") @PathVariable String channelDefinitionId, HttpServletResponse response) {
        ChannelDefinition channelDefinition = getChannelDefinitionFromRequest(channelDefinitionId);
        return getDeploymentResourceData(channelDefinition.getDeploymentId(), channelDefinition.getResourceName(), response);
    }

    /**
     * Returns the {@link ChannelDefinition} that is requested. Throws the right exceptions when bad request was made or definition was not found.
     */
    protected ChannelDefinition getChannelDefinitionFromRequest(String channelDefinitionId) {
        ChannelDefinition channelDefinition = repositoryService.createChannelDefinitionQuery().channelDefinitionId(channelDefinitionId).singleResult();

        if (channelDefinition == null) {
            throw new FlowableObjectNotFoundException("Could not find a channel definition with id '" + channelDefinitionId + "'.", ChannelDefinition.class);
        }

        if (restApiInterceptor != null) {
            restApiInterceptor.accessChannelDefinitionById(channelDefinition);
        }

        return channelDefinition;
    }
}

View on GitHub (pinned to d6d39ce1c6)