flowable/flowable-engine · error · FlowableException

deployment '${deploymentId}' didn't put event definition '${

Error message

deployment '${deploymentId}' didn't put event definition '${eventDefinitionId}' in the cache

What it means

FlowableException raised in resolveEventDefinition after re-deploying a deployment from disk into an empty cache: the deploy() completed but the cache still holds no entry for the requested eventDefinitionId. This indicates the deployment's persisted resources did not produce that definition id — an internal consistency problem between the database metadata and the deployed model resources.

Source

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

    public EventDefinitionCacheEntry resolveEventDefinition(EventDefinition eventDefinition) {
        String eventDefinitionId = eventDefinition.getId();
        String deploymentId = eventDefinition.getDeploymentId();

        EventDefinitionCacheEntry cachedEventDefinition = eventDefinitionCache.get(eventDefinitionId);

        if (cachedEventDefinition == null) {
            EventDeploymentEntity deployment = engineConfig.getDeploymentEntityManager().findById(deploymentId);
            List<EventResourceEntity> resources = engineConfig.getResourceEntityManager().findResourcesByDeploymentId(deploymentId);
            for (EventResourceEntity resource : resources) {
                deployment.addResource(resource);
            }

            deployment.setNew(false);
            deploy(deployment);
            cachedEventDefinition = eventDefinitionCache.get(eventDefinitionId);

            if (cachedEventDefinition == null) {
                throw new FlowableException("deployment '" + deploymentId + "' didn't put event definition '" + eventDefinitionId + "' in the cache");
            }
        }
        return cachedEventDefinition;
    }
    
    /**
     * Resolving the channel will fetch the channel definition, parse it and store the {@link ChannelDefinition} in memory.
     */
    public ChannelDefinitionCacheEntry resolveChannelDefinition(ChannelDefinition channelDefinition) {
        String channelDefinitionId = channelDefinition.getId();
        String deploymentId = channelDefinition.getDeploymentId();

        ChannelDefinitionCacheEntry cachedChannelDefinition = channelDefinitionCache.get(channelDefinitionId);

        if (cachedChannelDefinition == null) {
            EventDeploymentEntity deployment = engineConfig.getDeploymentEntityManager().findById(deploymentId);
            List<EventResourceEntity> resources = engineConfig.getResourceEntityManager().findResourcesByDeploymentId(deploymentId);
            for (EventResourceEntity resource : resources) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check the deployment's resources (getDeployment(d).getResources()) to confirm the event model file backing this definition id is present.
  2. Delete the broken deployment and redeploy the event model cleanly so definitions and resources stay consistent.
  3. Clear/inspect the event definition cache configuration; ensure a deployer actually parses and registers the definition.
  4. If data was migrated, verify definition rows reference resources belonging to the same deployment.

Example fix

// before
EventDefinitionEntity def = eventDeploymentManager.findDeployedEventDefinitionById(badDefinitionId);
// after
EventDefinition def = eventRepositoryService.createEventDefinitionQuery().deploymentId(deploymentId).list()
    .stream().filter(d -> d.getId().equals(definitionId)).findFirst()
    .orElseThrow(() -> new IllegalStateException("definition not in deployment, redeploy needed"));
Defensive patterns

Strategy: fallback

Validate before calling

EventDefinition def = eventRepositoryService.createEventDefinitionQuery().deploymentId(deploymentId).list()
    .stream().filter(d -> d.getId().equals(definitionId)).findFirst().orElse(null);
if (def == null) throw new IllegalStateException("definition " + definitionId + " missing from deployment " + deploymentId);

Try / catch

try {
    entity = manager.findDeployedEventDefinitionById(definitionId);
} catch (FlowableException e) {
    // redeploy the deployment or fail fast; this indicates data inconsistency
    throw new IllegalStateException("inconsistent deployment data for " + definitionId, e);
}

Prevention

When it happens

Trigger: Requesting an EventDefinitionEntity whose id exists in the definition table but whose parent deployment, when redeployed lazily, fails to register that definition id into eventDefinitionCache — e.g. resource missing from the deployment store or a deployer silently skipping the resource.

Common situations: Manually edited or partially migrated FLW_EV_ tables; deployment resources deleted while definition rows remain; custom deployers not registering definitions; corrupted deployment after a failed upgrade.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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