{"record":{"id":"ce130dcfc2366ff0","repo":"flowable/flowable-engine","slug":"error-reading-channel-json","errorCode":null,"errorMessage":"Error reading channel json","messagePattern":"Error reading channel json","errorType":"exception","errorClass":"FlowableEventJsonException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-json-converter/src/main/java/org/flowable/eventregistry/json/converter/ChannelJsonConverter.java","lineNumber":99,"sourceCode":"        addOutboundChannelModelClass(\"camel\", CamelOutboundChannelModel.class);\n        addOutboundChannelModelClass(\"expression\", DelegateExpressionOutboundChannelModel.class);\n    }\n\n    public ChannelModel convertToChannelModel(String modelJson) {\n        try {\n            ObjectMapper objectMapper = objectMapperSupplier.get();\n            JsonNode channelNode = objectMapper.readTree(modelJson);\n            Class<? extends ChannelModel> channelClass = determineChannelModelClass(channelNode);\n\n            ChannelModel channelModel = objectMapper.convertValue(channelNode, channelClass);\n\n            validateChannel(channelModel);\n\n            return channelModel;\n        } catch (FlowableEventJsonException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new FlowableEventJsonException(\"Error reading channel json\", e);\n        }\n    }\n\n    protected Class<? extends ChannelModel> determineChannelModelClass(JsonNode channelNode) {\n        String channelType = channelNode.path(\"channelType\").stringValue(null);\n        String type = channelNode.path(\"type\").stringValue(null);\n\n        Class<? extends ChannelModel> channelClass = channelModelClasses.get(channelType + \"-\" + type);\n        if (channelClass != null) {\n            return channelClass;\n        }\n\n        throw new FlowableEventJsonException(\"Not supported \" + channelType + \" channel model type was found \" + type);\n    }\n\n    protected void validateChannel(ChannelModel channelModel) {\n        for (ChannelValidator validator : validators) {\n            validator.validateChannel(channelModel);","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-json-converter/src/main/java/org/flowable/eventregistry/json/converter/ChannelJsonConverter.java#L81-L117","documentation":"ChannelJsonConverter.convertToChannelModel parses a channel definition JSON string into a ChannelModel. Any exception during JSON parsing or deserialization (other than an existing FlowableEventJsonException) is wrapped as FlowableEventJsonException('Error reading channel json') with the root cause attached. It signals malformed or unreadable channel JSON.","triggerScenarios":"Calling convertToChannelModel with invalid JSON syntax, JSON that does not match any ChannelModel subclass shape, or an ObjectMapper failure while parsing channel deployment resources.","commonSituations":"Deploying a channel model file (.channel/.json) with a syntax error or wrong structure, hand-editing exported JSON and breaking it, or a version mismatch where the JSON uses an unknown channelType/type combination.","solutions":["Inspect the wrapped cause exception (getCause()) to find the exact parsing failure.","Validate the channel JSON against the expected ChannelModel schema; fix syntax and required fields.","Ensure the JSON contains recognized 'channelType'/'type' values so determineChannelModelClass can resolve a class."],"exampleFix":"// before\nChannelModel model = converter.convertToChannelModel(brokenJson);\n// after\ntry {\n    ChannelModel model = converter.convertToChannelModel(channelJson);\n} catch (FlowableEventJsonException e) {\n    LOG.error(\"Invalid channel JSON: \" + e.getCause().getMessage());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"try {\n    JsonNode node = new ObjectMapper().readTree(channelJson);\n    if (node == null || !node.has(\"channelType\") || !node.has(\"type\")) {\n        throw new IllegalArgumentException(\"Channel JSON missing channelType/type\");\n    }\n} catch (JsonProcessingException e) {\n    throw new IllegalArgumentException(\"Channel JSON is not valid JSON\", e);\n}","typeGuard":"boolean isParsableChannelJson(String json) {\n    try { new ObjectMapper().readTree(json); return true; } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    ChannelModel model = converter.convertToChannelModel(json);\n} catch (FlowableEventJsonException e) {\n    LOG.error(\"Channel JSON invalid: {}\", e.getCause() != null ? e.getCause().getMessage() : e.getMessage());\n    throw new DeploymentException(\"Cannot deploy channel\", e);\n}","preventionTips":["Validate channel JSON files at build time with a schema check.","Always log e.getCause() — the wrapper message alone hides the parse error.","Regenerate JSON from the Flowable modeler instead of hand-editing."],"tags":["json","parsing","channel-model","deployment"],"backgroundTag":"json-unmarshal-failed","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"}