apache/seatunnel · error · java.lang.IllegalArgumentException

Json parsing exception, value '%s', and expected type '%s'

Error message

Json parsing exception, value '%s', and expected type '%s'

What it means

Thrown from ConfigUtil.convertValue when Jackson fails to deserialize a raw config value into the option's declared type — typically a String that is not valid JSON for the expected structure, or a scalar where an object/array was expected. It fires whenever a non-trivially-typed option (List, Map, POJO) receives a value whose text cannot be parsed; note that for List-typed options the code first attempts a comma-split fallback before this error escapes.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java:79

        } catch (JsonProcessingException e) {
            if (typeReference.getType() instanceof ParameterizedType
                    && List.class.equals(
                            ((ParameterizedType) typeReference.getType()).getRawType())) {
                try {
                    log.warn(
                            "Option '{}' is a List, and it is recommended to configure it as [\"string1\",\"string2\"]; we will only use ',' to split the String into a list.",
                            option.key());
                    return (T)
                            convertToList(
                                    rawValue,
                                    (Class<T>)
                                            ((ParameterizedType) typeReference.getType())
                                                    .getActualTypeArguments()[0]);
                } catch (Exception ignore) {
                    // nothing
                }
            }
            throw new IllegalArgumentException(
                    String.format(
                            "Json parsing exception, value '%s', and expected type '%s'",
                            rawValue, typeReference.getType().getTypeName()),
                    e);
        }
    }

    static <T> List<T> convertToList(Object rawValue, Class<T> clazz) {
        if (rawValue instanceof List) {
            return ((List<?>) rawValue)
                    .stream()
                            .map(value -> convertValue(convertToJsonString(value), clazz))
                            .collect(Collectors.toList());
        }
        return Arrays.stream(rawValue.toString().split(","))
                .map(String::trim)
                .map(value -> convertValue(value, clazz))
                .collect(Collectors.toList());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Write the option value as valid JSON matching the declared type, e.g. ["a","b"] for a List<String>
  2. For list options configured as a plain string, rely on the comma-split fallback or manually format as a JSON array
  3. Validate the config file syntax (unbalanced quotes/brackets) with a JSON linter before submitting the job
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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