{"record":{"id":"a72dc51dc6cd28c1","repo":"flowable/flowable-engine","slug":"unsupported-value-type-value-null-null","errorCode":null,"errorMessage":"Unsupported value type ${value == null ? \"null\" : value.getClass().getName()}","messagePattern":"Unsupported value type (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/json/jackson2/FlowableJackson2JsonNode.java","lineNumber":211,"sourceCode":"    protected static JsonNode asJsonNode(FlowableJsonNode value) {\n        if (value == null) {\n            return NullNode.getInstance();\n        }\n        return asJsonNode(value.getImplementationValue(), ObjectMapper::new);\n    }\n\n    protected static JsonNode asJsonNode(Object value, Supplier<ObjectMapper> objectMapperSupplier) {\n        if (value instanceof JsonNode) {\n            return (JsonNode) value;\n        } else if (JsonUtil.isJsonNode(value)) {\n            // This means it is a Jackson 3 node\n            try {\n                return objectMapperSupplier.get().readTree(value.toString());\n            } catch (JsonProcessingException e) {\n                throw new FlowableException(\"Failed to parse jase\", e);\n            }\n        } else {\n            throw new FlowableException(\"Unsupported value type \" + (value == null ? \"null\" : value.getClass().getName()));\n        }\n    }\n\n    public static FlowableJsonNode wrap(JsonNode jsonNode) {\n        if (jsonNode instanceof ArrayNode arrayNode) {\n            return new FlowableJackson2ArrayNode(arrayNode);\n        } else if (jsonNode instanceof ObjectNode objectNode) {\n            return new FlowableJackson2ObjectNode(objectNode);\n        } else if (jsonNode != null) {\n            return new FlowableJackson2JsonNode<>(jsonNode);\n        }\n        return null;\n    }\n}\n","sourceCodeStart":193,"sourceCodeEnd":226,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/json/jackson2/FlowableJackson2JsonNode.java#L193-L226","documentation":"FlowableJackson2JsonNode.asJsonNode only accepts values that are already Jackson 2 JsonNode instances or values recognized by JsonUtil.isJsonNode (Jackson 3 nodes). Anything else — including null and arbitrary objects like String or Map — is rejected with a FlowableException naming the actual runtime type.","triggerScenarios":"Calling FlowableJackson2JsonNode.asJsonNode(Object) with null, a plain String, Map, or any non-Jackson-node object; passing a variable fetched from storage that was not stored as a JSON node type.","commonSituations":"Reading process/execution variables expecting JSON but the variable was stored as a string; passing user-supplied objects into JSON conversion helpers; refactoring changed variable types between JSON string and JsonNode.","solutions":["Parse the value first (JsonUtil/jsonMapper.readTree) before passing it to asJsonNode","Check for null and validate the value is a JsonNode (or isJsonNode) before calling","Ensure the variable was created as a JSON-typed variable, not a plain string"],"exampleFix":"// before\nJsonNode node = FlowableJackson2JsonNode.asJsonNode(variableValue);\n// after\nJsonNode node = variableValue instanceof JsonNode\n    ? (JsonNode) variableValue\n    : FlowableJackson2JsonNode.asJsonNode(\n        JsonUtil.readTree(variableValue == null ? \"null\" : variableValue.toString()));","handlingStrategy":"type-guard","validationCode":"if (value == null) throw new IllegalArgumentException(\"Expected JSON node, got null\");\nif (!(value instanceof JsonNode) && !JsonUtil.isJsonNode(value)) throw new IllegalArgumentException(\"Unsupported type: \" + value.getClass());","typeGuard":"boolean isJsonNodeValue(Object v) { return v instanceof com.fasterxml.jackson.databind.JsonNode || JsonUtil.isJsonNode(v); }","tryCatchPattern":"try { return FlowableJackson2JsonNode.asJsonNode(v); } catch (FlowableException e) { return FlowableJackson2JsonNode.asJsonNode(JsonUtil.readTree(String.valueOf(v))); }","preventionTips":["Store JSON-typed variables as JsonNode, not strings","Null-check variables read from execution before JSON conversion","Wrap conversions in a small utility that normalizes strings to nodes first"],"tags":["jackson","json","type-mismatch","flowable"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}