{"record":{"id":"799c978e019424da","repo":"alibaba/spring-ai-alibaba","slug":"unsupported-array-type-representation","errorCode":null,"errorMessage":"Unsupported array type representation: {}","messagePattern":"Unsupported array type representation: (.+?)","errorType":"exception","errorClass":"ClassNotFoundException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/serializer/plain_text/jackson/JacksonDeserializer.java","lineNumber":521,"sourceCode":"\t * @throws IOException if binding fails\n\t */\n\tprivate static Object instantiateScalarPayloadArray(String className, JsonNode payload, ObjectMapper objectMapper)\n\t\t\tthrows IOException {\n\t\ttry {\n\t\t\tClass<?> arrayClass = resolveArrayClass(className);\n\t\t\treturn objectMapper.treeToValue(payload, arrayClass);\n\t\t}\n\t\tcatch (ClassNotFoundException | IllegalArgumentException ex) {\n\t\t\tthrow new IOException(\"Cannot instantiate array type from scalar payload: \" + className, ex);\n\t\t}\n\t}\n\n\tprivate static Class<?> resolveArrayClass(String className) throws ClassNotFoundException {\n\t\tif (className.startsWith(\"[\")) {\n\t\t\treturn Class.forName(className);\n\t\t}\n\t\tif (!className.endsWith(\"[]\")) {\n\t\t\tthrow new ClassNotFoundException(\"Unsupported array type representation: \" + className);\n\t\t}\n\t\tString componentName = className.substring(0, className.length() - 2);\n\t\treturn switch (componentName) {\n\t\t\tcase \"boolean\" -> boolean[].class;\n\t\t\tcase \"byte\" -> byte[].class;\n\t\t\tcase \"char\" -> char[].class;\n\t\t\tcase \"short\" -> short[].class;\n\t\t\tcase \"int\" -> int[].class;\n\t\t\tcase \"long\" -> long[].class;\n\t\t\tcase \"float\" -> float[].class;\n\t\t\tcase \"double\" -> double[].class;\n\t\t\tdefault -> Class.forName(\"[L\" + componentName + \";\");\n\t\t};\n\t}\n\n\t/**\n\t * Reconstruct GraphResponse from snapshot map.\n\t */","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/serializer/plain_text/jackson/JacksonDeserializer.java#L503-L539","documentation":"resolveArrayClass only understands JVM-style names starting with '[' (e.g. '[Ljava.lang.String;') and source-style names ending with '[]' (e.g. 'String[]', 'int[]'). Any other representation is rejected by throwing ClassNotFoundException with this message.","triggerScenarios":"arrayClass/resolveArrayClass receives a className that neither starts with '[' nor ends with '[]' — e.g. 'byte', 'java.lang.String', '[B[]x' typos, or a null/aliased type id written by a custom serializer.","commonSituations":"Custom TypeSerializer writing a bare component type name instead of an array name; migration from another serialization format; hand-edited checkpoint files.","solutions":["Fix the serialized type id to a supported form: JVM descriptor ('[I') or suffix form ('int[]')","If you control serialization, ensure default typing records the full array class name, not the component name","For primitives use the exact 'primitive[]' spelling: byte[], int[], boolean[], char[], etc.","Locate the producer of the malformed class name (custom serializer or external tool) and correct it"],"exampleFix":"// before\n{\"type\":\"byte\"}\n// after\n{\"type\":\"byte[]\"}","handlingStrategy":"validation","validationCode":"boolean valid = className.startsWith(\"[\") || className.endsWith(\"[]\");","typeGuard":"boolean isSupportedArrayName(String className) {\n    return className != null && (className.startsWith(\"[\") || className.endsWith(\"[]\"));\n}","tryCatchPattern":"try { Class<?> c = resolveArrayClass(name); } catch (ClassNotFoundException e) { if (e.getMessage().startsWith(\"Unsupported array type representation\")) { name = normalizeToArrayName(name); } else throw e; }","preventionTips":["Always record fully-qualified array class names in custom serializers","Add a unit test asserting your type ids round-trip through resolveArrayClass","Reject non-array-shaped type ids at write time rather than read time"],"tags":["deserialization","reflection","naming"],"backgroundTag":"invalid-identifier-format","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}