{"record":{"id":"2d70275c0906ac21","repo":"flowable/flowable-engine","slug":"channel-definition-bytes-is-null","errorCode":null,"errorMessage":"channel definition bytes is null","messagePattern":"channel definition bytes is null","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/repository/EventDeploymentBuilderImpl.java","lineNumber":123,"sourceCode":"        }\n\n        EventResourceEntity resource = resourceEntityManager.create();\n        resource.setName(resourceName);\n        resource.setBytes(eventDefinitionBytes);\n        deployment.addResource(resource);\n        return this;\n    }\n\n    @Override\n    public EventDeploymentBuilder addEventDefinition(String resourceName, String eventDefinition) {\n        addString(resourceName, eventDefinition);\n        return this;\n    }\n    \n    @Override\n    public EventDeploymentBuilder addChannelDefinitionBytes(String resourceName, byte[] channelDefinitionBytes) {\n        if (channelDefinitionBytes == null) {\n            throw new FlowableException(\"channel definition bytes is null\");\n        }\n\n        EventResourceEntity resource = resourceEntityManager.create();\n        resource.setName(resourceName);\n        resource.setBytes(channelDefinitionBytes);\n        deployment.addResource(resource);\n        return this;\n    }\n\n    @Override\n    public EventDeploymentBuilder addChannelDefinition(String resourceName, String channelDefinition) {\n        addString(resourceName, channelDefinition);\n        return this;\n    }\n\n    @Override\n    public EventDeploymentBuilder name(String name) {\n        deployment.setName(name);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/repository/EventDeploymentBuilderImpl.java#L105-L141","documentation":"FlowableException thrown by EventDeploymentBuilderImpl.addChannelDefinitionBytes when the byte[] argument is null. Channel definition bytes are stored as a deployment resource; null payloads are rejected before entity creation.","triggerScenarios":"Calling deploymentBuilder.addChannelDefinitionBytes(resourceName, null); typically bytes from an unsuccessful file/HTTP load.","commonSituations":"Channel definition JSON fetched from a service that returned null body; build-time generated bytes not produced due to a failed codegen step.","solutions":["Verify the byte[] is non-null (and non-empty) before calling addChannelDefinitionBytes.","Check the upstream loader/fetch that produced the bytes and fail fast there.","Use addChannelDefinition(String) for classpath resources instead of manually loaded bytes."],"exampleFix":"// before\nbyte[] bytes = fetchChannelDef(\"inbound-orders\"); // may return null\nbuilder.addChannelDefinitionBytes(\"inbound-orders.channel\", bytes);\n// after\nbyte[] bytes = fetchChannelDef(\"inbound-orders\");\nObjects.requireNonNull(bytes, \"channel definition bytes missing for inbound-orders\");\nbuilder.addChannelDefinitionBytes(\"inbound-orders.channel\", bytes);","handlingStrategy":"validation","validationCode":"if (bytes == null || bytes.length == 0) { throw new IllegalArgumentException(\"channel definition bytes must be non-empty\"); }","typeGuard":"boolean ok = bytes != null && bytes.length > 0;","tryCatchPattern":"try { builder.addChannelDefinitionBytes(name, bytes); } catch (FlowableException e) { LOG.error(\"null channel definition bytes\"); throw e; }","preventionTips":["Fail fast at fetch/load time when channel definitions are missing","Use addChannelDefinition(String) for classpath resources","Keep generated definitions under build validation"],"tags":["flowable","deployment","null-check","validation"],"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"}