flowable/flowable-engine · error · FlowableException

Invalid channel definition id : null

Error message

Invalid channel definition id : null

What it means

findDeployedChannelDefinitionById requires a non-null channelDefinitionId; passing null throws a plain FlowableException immediately. This is a fail-fast argument check mirroring the event-definition variant.

Solutions

  1. Ensure the channel definition id is populated before lookup; on first deploy there is no previous id, so skip the lookup when null
  2. Null-check at the call site before invoking
  3. Fix the producer of the id (definition JSON, database row, deployment object) to always supply it

Example fix

// before
ChannelDefinitionEntity prev = deploymentManager.findDeployedChannelDefinitionById(old.getId());
// after
if (old != null && old.getId() != null) {
    prev = deploymentManager.findDeployedChannelDefinitionById(old.getId());
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (channelDefinitionId == null || channelDefinitionId.isEmpty()) {
    throw new IllegalArgumentException("channelDefinitionId is required");
}

Type guard

boolean hasChannelId(String id) { return id != null && !id.trim().isEmpty(); }

Try / catch

try {
    ch = deploymentManager.findDeployedChannelDefinitionById(id);
} catch (org.flowable.common.engine.api.FlowableException e) {
    throw new IllegalArgumentException("channel definition id must not be null", e);
}

Prevention

When it happens

Trigger: Calling findDeployedChannelDefinitionById(null), e.g. when resolving a previous channel definition during redeployment where the old definition's id was never stored, or an unset configuration field.

Common situations: Redeployment commands looking up previousChannelDefinition with a null id on first deploy; incomplete channel metadata from a JSON definition file; null values in a deployment builder.

Related errors


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

Appendix: source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java:90

        }

        // first try the cache
        EventDefinitionCacheEntry cacheEntry = eventDefinitionCache.get(eventDefinitionId);
        EventDefinitionEntity eventDefinition = cacheEntry != null ? cacheEntry.getEventDefinitionEntity() : null;

        if (eventDefinition == null) {
            eventDefinition = engineConfig.getEventDefinitionEntityManager().findById(eventDefinitionId);
            if (eventDefinition == null) {
                throw new FlowableObjectNotFoundException("no deployed event definition found with id '" + eventDefinitionId + "'");
            }
            eventDefinition = resolveEventDefinition(eventDefinition).getEventDefinitionEntity();
        }
        return eventDefinition;
    }
    
    public ChannelDefinitionEntity findDeployedChannelDefinitionById(String channelDefinitionId) {
        if (channelDefinitionId == null) {
            throw new FlowableException("Invalid channel definition id : null");
        }

        // first try the cache
        ChannelDefinitionCacheEntry cacheEntry = channelDefinitionCache.get(channelDefinitionId);
        ChannelDefinitionEntity channelDefinition = cacheEntry != null ? cacheEntry.getChannelDefinitionEntity() : null;

        if (channelDefinition == null) {
            channelDefinition = engineConfig.getChannelDefinitionEntityManager().findById(channelDefinitionId);
            if (channelDefinition == null) {
                throw new FlowableObjectNotFoundException("no deployed channel definition found with id '" + channelDefinitionId + "'");
            }
            channelDefinition = resolveChannelDefinition(channelDefinition).getChannelDefinitionEntity();
        }
        return channelDefinition;
    }

    public EventDefinitionEntity findDeployedLatestEventDefinitionByKey(String eventDefinitionKey) {
        EventDefinitionEntity eventDefinition = eventDefinitionEntityManager.findLatestEventDefinitionByKey(eventDefinitionKey);

View on GitHub (pinned to d6d39ce1c6)