apache/seatunnel · error · IllegalArgumentException

Unsupported parameter type:

Error message

Unsupported parameter type: 

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/connection/DataSourceUtils.java:102

    private static Object convertType(Object value, Class<?> targetType) {
        if (targetType.isInstance(value)) {
            return value;
        }
        if (targetType == Integer.class || targetType == int.class) {
            return Integer.parseInt(value.toString());
        } else if (targetType == Long.class || targetType == long.class) {
            return Long.parseLong(value.toString());
        } else if (targetType == Boolean.class || targetType == boolean.class) {
            return Boolean.parseBoolean(value.toString());
        } else if (targetType == Double.class || targetType == double.class) {
            return Double.parseDouble(value.toString());
        } else if (targetType == Float.class || targetType == float.class) {
            return Float.parseFloat(value.toString());
        } else if (targetType == String.class) {
            return value.toString();
        }
        throw new IllegalArgumentException("Unsupported parameter type: " + targetType);
    }

    private static Method findGetterMethod(final DataSource dataSource, final String propertyName)
            throws NoSuchMethodException {
        String getterMethodName =
                GETTER_PREFIX + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, propertyName);
        Method result = dataSource.getClass().getMethod(getterMethodName);
        result.setAccessible(true);
        return result;
    }

    private static Optional<Method> findSetterMethod(
            final Method[] methods, final String property) {
        String setterMethodName =
                SETTER_PREFIX + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, property);
        Optional<Method> methodOptional =
                Arrays.stream(methods)
                        .filter(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set only properties whose getters/setters accept String, boolean, int, long, float, or double
  2. Check the driver's DataSource class Javadoc for supported property types
  3. Remove the offending property if it is not required
  4. Pass String-typed values that the driver itself parses, where supported

Example fix

// before
props.put("loginTimeout", "30s"); // no setter for Duration
// after
props.put("loginTimeout", "30"); // int setter
Defensive patterns

Strategy: validation

Validate before calling

// whitelist datasource property types before applying
Set<String> supported = Set.of("user","password","url","loginTimeout","portNumber");
props.keySet().removeIf(k -> !supported.contains(k));

Try / catch

try { DataSourceUtils.dataSource(xaClassName, props); } catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("Unsupported parameter type")) { /* drop/fix that property */ }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/6b460cdf725ffa41. Report an issue: GitHub.