{"record":{"id":"9c3ddb71453e1edb","repo":"apache/dubbo","slug":"unsupported-type-classname-type","errorCode":null,"errorMessage":"Unsupported type ${className}:${type}","messagePattern":"Unsupported type (.+?):(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtil.java","lineNumber":303,"sourceCode":"                        setByMethod = true;\n                    }\n                } catch (Exception e) {\n                    LogHelper.warn(logger, \"Failed to set property through method \" + method, e);\n                }\n\n                if (!setByMethod) {\n                    try {\n                        Field field = result.getClass().getField(property);\n                        if (field != null) {\n                            field.set(result, value);\n                        }\n                    } catch (NoSuchFieldException | IllegalAccessException e1) {\n                        LogHelper.warn(logger, \"Failed to set field value\", e1);\n                    }\n                }\n            }\n        } else {\n            throw new IllegalArgumentException(\n                    \"Unsupported type \" + beanDescriptor.getClassName() + \":\" + beanDescriptor.getType());\n        }\n    }\n\n    private static Method getSetterMethod(Class<?> cls, String property, Class<?> valueCls) {\n        String name = \"set\" + property.substring(0, 1).toUpperCase() + property.substring(1);\n        Method method = null;\n        try {\n            method = cls.getMethod(name, valueCls);\n        } catch (NoSuchMethodException e) {\n            for (Method m : cls.getMethods()) {\n                if (ReflectUtils.isBeanPropertyWriteMethod(m) && m.getName().equals(name)) {\n                    method = m;\n                }\n            }\n        }\n        if (method != null) {\n            method.setAccessible(true);","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtil.java#L285-L321","documentation":"Thrown by deserializeInternal when a JavaBeanDescriptor's type field matches none of the recognized categories (enum, class, primitive, array, collection, map, bean). The message prints className:type so the invalid type integer is visible. It indicates a corrupt or hand-crafted descriptor whose type is outside TYPE_CLASS..TYPE_BEAN.","triggerScenarios":"JavaBeanSerializeUtil.deserialize(descriptor) where descriptor.getType() is 0, negative, or > 7; a descriptor deserialized from tampered/corrupted transport bytes whose type byte was altered.","commonSituations":"A peer running a different/older Dubbo version that writes a type value the receiver does not know; manual construction with setType() to an invalid constant; byte-level corruption of the descriptor on the wire.","solutions":["Validate descriptor.getType() is in [1..7] (TYPE_CLASS..TYPE_BEAN) before calling deserialize.","Ensure producer and consumer run the same Dubbo version so descriptor type constants agree.","If the descriptor was hand-built, construct it with new JavaBeanDescriptor(name, TYPE_*) which already validates the type."],"exampleFix":"// before\nObject o = JavaBeanSerializeUtil.deserialize(descriptor);\n\n// after\nint t = descriptor.getType();\nif (t < JavaBeanDescriptor.TYPE_CLASS || t > JavaBeanDescriptor.TYPE_BEAN) {\n    throw new IllegalArgumentException(\"refusing descriptor with invalid type \" + t);\n}\nObject o = JavaBeanSerializeUtil.deserialize(descriptor);","handlingStrategy":"validation","validationCode":"int t = descriptor.getType();\nif (t < JavaBeanDescriptor.TYPE_CLASS || t > JavaBeanDescriptor.TYPE_BEAN) {\n    throw new IllegalArgumentException(\"invalid descriptor type: \" + t);\n}\nJavaBeanSerializeUtil.deserialize(descriptor);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build descriptors via new JavaBeanDescriptor(name, TYPE_*) so the type is validated at construction.","Do not call setType() with arbitrary integers.","Keep producer and consumer Dubbo versions aligned."],"tags":["beanutil","serialization","validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}