apache/flink · error · IllegalArgumentException

Unsupported serializer type %s for %s

Error message

Unsupported serializer type %s for %s

What it means

Thrown by the default case of the switch statement in parseSerializationConfig when the 'type' key of a serialization-config entry is not one of the three supported values: pojo, kryo, or typeinfo. This is a validation failure on the config string value; the message reports the unsupported type and the affected class.

Source

Thrown at flink-core/src/main/java/org/apache/flink/api/common/serialization/SerializerConfigImpl.java:421

                serializationConfigByClass.entrySet()) {
            Class<?> type = entry.getKey();
            Map<String, String> config = entry.getValue();
            String configType = config.get("type");
            if (configType == null) {
                throw new IllegalArgumentException("Serializer type not specified for " + type);
            }
            switch (configType) {
                case "pojo":
                    registerPojoType(type);
                    break;
                case "kryo":
                    parseAndRegisterKryoType(classLoader, type, config);
                    break;
                case "typeinfo":
                    parseAndRegisterTypeFactory(classLoader, type, config);
                    break;
                default:
                    throw new IllegalArgumentException(
                            String.format(
                                    "Unsupported serializer type %s for %s", configType, type));
            }
        }
    }

    private void parseAndRegisterKryoType(
            ClassLoader classLoader, Class<?> t, Map<String, String> m) {
        String kryoType = m.get("kryo-type");
        if (kryoType == null) {
            registerKryoType(t);
        } else {
            switch (kryoType) {
                case "default":
                    addDefaultKryoSerializer(
                            t,
                            loadClass(
                                    m.get("class"),

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Set the 'type' key to exactly one of: pojo, kryo, or typeinfo (case-sensitive, lowercase).
  2. Double-check the spelling against the Flink serialization-config documentation.
  3. Remove the entry if you are unsure which type to use; let Flink use its default serializer selection.

Example fix

# before (typo)
pipeline.serialization-config: "class:com.example.MyType{type:Pojo}"

# after
pipeline.serialization-config: "class:com.example.MyType{type:pojo}"
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Set.of("pojo", "kryo", "typeinfo");
for (Map.Entry<String, Map<String, String>> e : entries.entrySet()) {
    String type = e.getValue().get("type");
    if (!valid.contains(type)) {
        throw new IllegalArgumentException(
            "Invalid type '" + type + "' for " + e.getKey() + "; must be one of " + valid);
    }
}

Prevention

When it happens

Trigger: Setting pipeline.serialization-config with a type value like 'json', 'avro', or a typo like 'pjo'. The switch has no case for it, so the default branch throws.

Common situations: Typo in the type field (e.g. 'Pojo' with capital P, or 'kryoo'); using a serializer type name from an older/newer Flink version; guessing the type value without consulting docs.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/66306c955149054e. Report an issue: GitHub.