flowable/flowable-engine · error · FlowableEventJsonException

Error reading channel json

Error message

Error reading channel json

What it means

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.

Solutions

  1. Inspect the wrapped cause exception (getCause()) to find the exact parsing failure.
  2. Validate the channel JSON against the expected ChannelModel schema; fix syntax and required fields.
  3. Ensure the JSON contains recognized 'channelType'/'type' values so determineChannelModelClass can resolve a class.

Example fix

// before
ChannelModel model = converter.convertToChannelModel(brokenJson);
// after
try {
    ChannelModel model = converter.convertToChannelModel(channelJson);
} catch (FlowableEventJsonException e) {
    LOG.error("Invalid channel JSON: " + e.getCause().getMessage());
    throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

try {
    JsonNode node = new ObjectMapper().readTree(channelJson);
    if (node == null || !node.has("channelType") || !node.has("type")) {
        throw new IllegalArgumentException("Channel JSON missing channelType/type");
    }
} catch (JsonProcessingException e) {
    throw new IllegalArgumentException("Channel JSON is not valid JSON", e);
}

Type guard

boolean isParsableChannelJson(String json) {
    try { new ObjectMapper().readTree(json); return true; } catch (Exception e) { return false; }
}

Try / catch

try {
    ChannelModel model = converter.convertToChannelModel(json);
} catch (FlowableEventJsonException e) {
    LOG.error("Channel JSON invalid: {}", e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
    throw new DeploymentException("Cannot deploy channel", e);
}

Prevention

When it happens

Trigger: Calling convertToChannelModel with invalid JSON syntax, JSON that does not match any ChannelModel subclass shape, or an ObjectMapper failure while parsing channel deployment resources.

Common situations: 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.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-event-registry-json-converter/src/main/java/org/flowable/eventregistry/json/converter/ChannelJsonConverter.java:99

        addOutboundChannelModelClass("camel", CamelOutboundChannelModel.class);
        addOutboundChannelModelClass("expression", DelegateExpressionOutboundChannelModel.class);
    }

    public ChannelModel convertToChannelModel(String modelJson) {
        try {
            ObjectMapper objectMapper = objectMapperSupplier.get();
            JsonNode channelNode = objectMapper.readTree(modelJson);
            Class<? extends ChannelModel> channelClass = determineChannelModelClass(channelNode);

            ChannelModel channelModel = objectMapper.convertValue(channelNode, channelClass);

            validateChannel(channelModel);

            return channelModel;
        } catch (FlowableEventJsonException e) {
            throw e;
        } catch (Exception e) {
            throw new FlowableEventJsonException("Error reading channel json", e);
        }
    }

    protected Class<? extends ChannelModel> determineChannelModelClass(JsonNode channelNode) {
        String channelType = channelNode.path("channelType").stringValue(null);
        String type = channelNode.path("type").stringValue(null);

        Class<? extends ChannelModel> channelClass = channelModelClasses.get(channelType + "-" + type);
        if (channelClass != null) {
            return channelClass;
        }

        throw new FlowableEventJsonException("Not supported " + channelType + " channel model type was found " + type);
    }

    protected void validateChannel(ChannelModel channelModel) {
        for (ChannelValidator validator : validators) {
            validator.validateChannel(channelModel);

View on GitHub (pinned to d6d39ce1c6)