{"record":{"id":"7d9aedbe4ef79085","repo":"flowable/flowable-engine","slug":"invalid-channel-definition-id-null","errorCode":null,"errorMessage":"Invalid channel definition id : null","messagePattern":"Invalid channel definition id : null","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java","lineNumber":90,"sourceCode":"        }\n\n        // first try the cache\n        EventDefinitionCacheEntry cacheEntry = eventDefinitionCache.get(eventDefinitionId);\n        EventDefinitionEntity eventDefinition = cacheEntry != null ? cacheEntry.getEventDefinitionEntity() : null;\n\n        if (eventDefinition == null) {\n            eventDefinition = engineConfig.getEventDefinitionEntityManager().findById(eventDefinitionId);\n            if (eventDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed event definition found with id '\" + eventDefinitionId + \"'\");\n            }\n            eventDefinition = resolveEventDefinition(eventDefinition).getEventDefinitionEntity();\n        }\n        return eventDefinition;\n    }\n    \n    public ChannelDefinitionEntity findDeployedChannelDefinitionById(String channelDefinitionId) {\n        if (channelDefinitionId == null) {\n            throw new FlowableException(\"Invalid channel definition id : null\");\n        }\n\n        // first try the cache\n        ChannelDefinitionCacheEntry cacheEntry = channelDefinitionCache.get(channelDefinitionId);\n        ChannelDefinitionEntity channelDefinition = cacheEntry != null ? cacheEntry.getChannelDefinitionEntity() : null;\n\n        if (channelDefinition == null) {\n            channelDefinition = engineConfig.getChannelDefinitionEntityManager().findById(channelDefinitionId);\n            if (channelDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed channel definition found with id '\" + channelDefinitionId + \"'\");\n            }\n            channelDefinition = resolveChannelDefinition(channelDefinition).getChannelDefinitionEntity();\n        }\n        return channelDefinition;\n    }\n\n    public EventDefinitionEntity findDeployedLatestEventDefinitionByKey(String eventDefinitionKey) {\n        EventDefinitionEntity eventDefinition = eventDefinitionEntityManager.findLatestEventDefinitionByKey(eventDefinitionKey);","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java#L72-L108","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the channel definition id is populated before lookup; on first deploy there is no previous id, so skip the lookup when null","Null-check at the call site before invoking","Fix the producer of the id (definition JSON, database row, deployment object) to always supply it"],"exampleFix":"// before\nChannelDefinitionEntity prev = deploymentManager.findDeployedChannelDefinitionById(old.getId());\n// after\nif (old != null && old.getId() != null) {\n    prev = deploymentManager.findDeployedChannelDefinitionById(old.getId());\n}","handlingStrategy":"type-guard","validationCode":"if (channelDefinitionId == null || channelDefinitionId.isEmpty()) {\n    throw new IllegalArgumentException(\"channelDefinitionId is required\");\n}","typeGuard":"boolean hasChannelId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try {\n    ch = deploymentManager.findDeployedChannelDefinitionById(id);\n} catch (org.flowable.common.engine.api.FlowableException e) {\n    throw new IllegalArgumentException(\"channel definition id must not be null\", e);\n}","preventionTips":["Skip previous-definition lookups when deploying for the first time (no previous id exists)","Null-check ids pulled from stored deployments before reusing them","Validate channel model JSON fields before deployment"],"tags":["java","event-registry","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}