{"record":{"id":"b2d96970ff8a23a5","repo":"flowable/flowable-engine","slug":"unsupported-value-type-value-null-null-b2d969","errorCode":null,"errorMessage":"Unsupported value type \" + (value == null ? \"null\" : value.getClass().getName())","messagePattern":"Unsupported value type \" \\+ \\(value == null \\? \"null\" : value\\.getClass\\(\\)\\.getName\\(\\)\\)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/json/jackson3/FlowableJackson3JsonNode.java","lineNumber":226,"sourceCode":"    public String getNodeType() {\n        return jsonNode.getNodeType().name();\n    }\n\n    protected static JsonNode asJsonNode(FlowableJsonNode value) {\n        if (value == null) {\n            return NullNode.getInstance();\n        }\n        return asJsonNode(value.getImplementationValue(), JsonMapper::shared);\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 2 node\n            return objectMapperSupplier.get().readTree(value.toString());\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 FlowableJackson3ArrayNode(arrayNode);\n        } else if (jsonNode instanceof ObjectNode objectNode) {\n            return new FlowableJackson3ObjectNode(objectNode);\n        } else if (jsonNode != null) {\n            return new FlowableJackson3JsonNode<>(jsonNode);\n        }\n        return null;\n    }\n}\n","sourceCodeStart":208,"sourceCodeEnd":241,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/json/jackson3/FlowableJackson3JsonNode.java#L208-L241","documentation":"FlowableJackson3JsonNode.asJsonNode (Jackson 3 variant) accepts Jackson JsonNode values and Jackson 2 nodes (detected via JsonUtil.isJsonNode, converted by re-parsing toString()), and throws FlowableException for anything else, including null and plain Java types. Note the message string in the throwing code concatenates without interpolation of the class name prefix; the actual message is 'Unsupported value type ' plus the type name.","triggerScenarios":"Calling FlowableJackson3JsonNode.asJsonNode(Object) with null, a String, Map, or other non-Jackson-node object; passing a value stored as a JSON string variable into an API expecting a JsonNode.","commonSituations":"Mixing Jackson 2 and Jackson 3 in one application during migration; variables persisted as strings read through node-based APIs; helper methods given user objects instead of parsed nodes.","solutions":["Parse the value into a JsonNode before calling asJsonNode","Null-check and instanceof-check the value before conversion","Store variables with JSON node types so they round-trip as nodes"],"exampleFix":"// before\nJsonNode node = FlowableJackson3JsonNode.asJsonNode(varValue);\n// after\nJsonNode node = (varValue instanceof JsonNode jn)\n    ? jn\n    : FlowableJackson3JsonNode.asJsonNode(jsonMapper.readTree(String.valueOf(varValue)));","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: \" + value.getClass());","typeGuard":"boolean isJackson3NodeValue(Object v) { return v instanceof tools.jackson.databind.JsonNode || JsonUtil.isJsonNode(v); }","tryCatchPattern":"try { return FlowableJackson3JsonNode.asJsonNode(v); } catch (FlowableException e) { logger.warn(\"Unsupported value type: {}\", v == null ? \"null\" : v.getClass()); throw e; }","preventionTips":["During Jackson 2 to 3 migration, convert nodes at one boundary layer only","Never pass raw strings/maps into asJsonNode; parse first","Add unit tests for variable type round-trips"],"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"}