{"record":{"id":"36cc51f151ddc2ed","repo":"nathanmarz/storm","slug":"unable-to-create-serializer-serializerclass-getname-for","errorCode":null,"errorMessage":"Unable to create serializer \"${serializerClass.getName()}\" for class: ${superClass.getName()}","messagePattern":"Unable to create serializer \"(.+?)\" for class: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/serialization/SerializationFactory.java","lineNumber":197,"sourceCode":"                    } catch (Exception ex3) {\n                        try {\n                            return serializerClass.getConstructor(Kryo.class).newInstance(k);\n                        } catch (Exception ex4) {\n                            try {\n                                return serializerClass.getConstructor(Class.class, Map.class).newInstance(superClass, conf);\n                            } catch (Exception ex5) {\n                                try {\n                                    return serializerClass.getConstructor(Class.class).newInstance(superClass);\n                                } catch (Exception ex6) {\n                                    return serializerClass.newInstance();\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        } catch (Exception ex) {\n            throw new IllegalArgumentException(\"Unable to create serializer \\\"\"\n                                               + serializerClass.getName()\n                                               + \"\\\" for class: \"\n                                               + superClass.getName(), ex);\n        }\n    }\n\n    private static Map<String, String> normalizeKryoRegister(Map conf) {\n        // TODO: de-duplicate this logic with the code in nimbus\n        Object res = conf.get(Config.TOPOLOGY_KRYO_REGISTER);\n        if(res==null) return new TreeMap<String, String>();\n        Map<String, String> ret = new HashMap<String, String>();\n        if(res instanceof Map) {\n            ret = (Map<String, String>) res;\n        } else {\n            for(Object o: (List) res) {\n                if(o instanceof Map) {\n                    ret.putAll((Map) o);\n                } else {","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/serialization/SerializationFactory.java#L179-L215","documentation":"SerializationFactory.resolveSerializerInstance instantiates a Kryo serializer class registered for a type. When Class.newInstance() (or equivalent) throws any Exception, it is wrapped in this IllegalArgumentException, naming the serializer class and the class it was meant to serialize. It means the registered serializer class cannot be instantiated — typically no public no-arg constructor, a constructor that throws, or wrong type (not a Serializer subclass for that class).","triggerScenarios":"Registering a serializer class via Config.TOPOLOGY_KRYO_REGISTER (or topology.kryo.register) whose class has no public no-arg constructor, whose constructor throws, that is abstract, or whose static initializer fails; Kryo calls newInstance during getKryo/serializer resolution at topology startup.","commonSituations":"Custom serializers written without a no-arg constructor; serializers requiring constructor arguments (Kryo needs Class-based instantiation); class present in jar but missing dependencies so its static init or constructor throws ClassNotFound/NoClassDefFound; packaging a serializer from a different Kryo version.","solutions":["Give the serializer class a public no-arg constructor, or register an Instance/SerializerFactory (Kryo.register(cls, new InstanceSerializer(...)/new SerializerFactory)) instead of the raw class","Make sure the serializer class extends the expected Kryo Serializer for the registered class and is public, non-abstract, and static (not a non-static inner class)","Check the wrapped cause in the exception for the real failure (e.g. ClassNotFoundException, InvocationTargetException) and fix the missing dependency or throwing init code","Ensure the topology jar actually contains the serializer class and its dependencies (shade/assembly plugin includes it)"],"exampleFix":"// before\npublic class MySerializer extends Serializer<MyType> {\n    public MySerializer(String param) { ... } // no no-arg ctor\n}\nconf.registerSerialization(MyType.class, MySerializer.class);\n\n// after\npublic class MySerializer extends Serializer<MyType> {\n    public MySerializer() { } // public no-arg constructor\n}\nconf.registerSerialization(MyType.class, MySerializer.class);","handlingStrategy":"validation","validationCode":"// before submitting topology, for each registered serializer:\nClass<?> ser = Class.forName(serializerClassName);\nif (java.lang.reflect.Modifier.isAbstract(ser.getModifiers()))\n    throw new IllegalStateException(ser + \" is abstract\");\nser.getDeclaredConstructor(); // fails fast if no no-arg ctor\nif (!com.esotericsoftware.kryo.Serializer.class.isAssignableFrom(ser))\n    throw new IllegalStateException(ser + \" is not a Kryo Serializer\");","typeGuard":null,"tryCatchPattern":"try {\n    launchTopology(conf);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unable to create serializer\")) {\n        // inspect e.getCause() for the real instantiation failure\n    }\n    throw e;\n}","preventionTips":["Always give custom Kryo serializers a public no-arg constructor","Test serializer registration in local mode (LocalCluster) before cluster deploy","Register via Kryo's SerializerFactory/Instance when the serializer needs constructor args","Shade all serializer dependencies into the topology jar"],"tags":["kryo","serialization","storm","config"],"backgroundTag":"invalid-config-value","analyzedSha":"cdb116e942666973bc4eaa0df098d5bab82739e7","analyzedAt":"2026-09-12T14:30:00.714Z","contentChangedAt":"2026-09-12T14:30:00.714Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}