{"record":{"id":"6b460cdf725ffa41","repo":"apache/seatunnel","slug":"unsupported-parameter-type","errorCode":null,"errorMessage":"Unsupported parameter type: ","messagePattern":"Unsupported parameter type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/connection/DataSourceUtils.java","lineNumber":102,"sourceCode":"\n    private static Object convertType(Object value, Class<?> targetType) {\n        if (targetType.isInstance(value)) {\n            return value;\n        }\n        if (targetType == Integer.class || targetType == int.class) {\n            return Integer.parseInt(value.toString());\n        } else if (targetType == Long.class || targetType == long.class) {\n            return Long.parseLong(value.toString());\n        } else if (targetType == Boolean.class || targetType == boolean.class) {\n            return Boolean.parseBoolean(value.toString());\n        } else if (targetType == Double.class || targetType == double.class) {\n            return Double.parseDouble(value.toString());\n        } else if (targetType == Float.class || targetType == float.class) {\n            return Float.parseFloat(value.toString());\n        } else if (targetType == String.class) {\n            return value.toString();\n        }\n        throw new IllegalArgumentException(\"Unsupported parameter type: \" + targetType);\n    }\n\n    private static Method findGetterMethod(final DataSource dataSource, final String propertyName)\n            throws NoSuchMethodException {\n        String getterMethodName =\n                GETTER_PREFIX + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, propertyName);\n        Method result = dataSource.getClass().getMethod(getterMethodName);\n        result.setAccessible(true);\n        return result;\n    }\n\n    private static Optional<Method> findSetterMethod(\n            final Method[] methods, final String property) {\n        String setterMethodName =\n                SETTER_PREFIX + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, property);\n        Optional<Method> methodOptional =\n                Arrays.stream(methods)\n                        .filter(","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/connection/DataSourceUtils.java#L84-L120","documentation":"Thrown by DataSourceUtils.convertType when a datasource property value cannot be converted to the setter method's expected parameter type. Only Integer/Long/Double/Float/Boolean/String conversions are supported; any other target type raises this IllegalArgumentException naming the unsupported type.","triggerScenarios":"Configuring a XA/DataSource property (via setProperties) whose JavaBean setter takes a type outside the supported set (e.g. int[] , java.time.Duration, custom object) — conversion reaches the final else branch.","commonSituations":"Typo or exotic property name resolving to a setter with an unusual parameter type; driver-specific property expecting an enum or object type; version change where a setter's type changed.","solutions":["Set only properties whose getters/setters accept String, boolean, int, long, float, or double","Check the driver's DataSource class Javadoc for supported property types","Remove the offending property if it is not required","Pass String-typed values that the driver itself parses, where supported"],"exampleFix":"// before\nprops.put(\"loginTimeout\", \"30s\"); // no setter for Duration\n// after\nprops.put(\"loginTimeout\", \"30\"); // int setter","handlingStrategy":"validation","validationCode":"// whitelist datasource property types before applying\nSet<String> supported = Set.of(\"user\",\"password\",\"url\",\"loginTimeout\",\"portNumber\");\nprops.keySet().removeIf(k -> !supported.contains(k));","typeGuard":null,"tryCatchPattern":"try { DataSourceUtils.dataSource(xaClassName, props); } catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unsupported parameter type\")) { /* drop/fix that property */ }\n}","preventionTips":["Only set properties backed by simple-type (String/primitive) setters","Consult driver DataSource Javadoc for property types","Add one property at a time to isolate bad config","Avoid enum/object-typed driver properties"],"tags":["jdbc","datasource","type-conversion","config"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}