{"record":{"id":"1dd69bfbc78a1768","repo":"nathanmarz/storm","slug":"fail-to-construct-messaging-plugin-from-plugin-transport","errorCode":null,"errorMessage":"Fail to construct messaging plugin from plugin ${transport_plugin_klassName}","messagePattern":"Fail to construct messaging plugin from plugin (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/messaging/TransportFactory.java","lineNumber":53,"sourceCode":"        IContext transport = null;\n        try {\n            //create a factory class\n            Class klass = Class.forName(transport_plugin_klassName);\n            //obtain a context object\n            Object obj = klass.newInstance();\n            if (obj instanceof IContext) {\n                //case 1: plugin is a IContext class\n                transport = (IContext)obj;\n                //initialize with storm configuration\n                transport.prepare(storm_conf);\n            } else {\n                //case 2: Non-IContext plugin must have a makeContext(storm_conf) method that returns IContext object\n                Method method = klass.getMethod(\"makeContext\", Map.class);\n                LOG.debug(\"object:\"+obj+\" method:\"+method);\n                transport = (IContext) method.invoke(obj, storm_conf);\n            }\n        } catch(Exception e) {\n            throw new RuntimeException(\"Fail to construct messaging plugin from plugin \"+transport_plugin_klassName, e);\n        } \n        return transport;\n    }\n}\n","sourceCodeStart":35,"sourceCodeEnd":58,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/messaging/TransportFactory.java#L35-L58","documentation":"TransportFactory.makeContext instantiates the configured messaging transport plugin (Config.STORM_MESSAGING_TRANSPORT) either as an IContext or via a makeContext(Map) method. Any exception during class loading, casting, or reflective invocation is wrapped in a RuntimeException naming the plugin class.","triggerScenarios":"Config.STORM_MESSAGING_TRANSPORT pointing to a class that doesn't exist, isn't on the classpath, doesn't implement IContext or expose makeContext(Map), whose constructor fails, or whose returned object isn't IContext (bad cast).","commonSituations":"Typos in the fully-qualified class name; custom transport plugin jar missing from supervisor/nimbus classpath; plugin written for a different Storm version (method signature change); plugin's makeContext throwing internally (e.g. failed to bind port).","solutions":["Check the wrapped cause 'Caused by' to find the real failure (ClassNotFound, NoSuchMethod, inner exception).","Verify Config.STORM_MESSAGING_TRANSPORT is the correct fully-qualified class (default backtype.storm.messaging.netty.Context).","Ensure the plugin jar is on the classpath of every process (nimbus, supervisors, workers).","Confirm the plugin implements IContext or has public static/non-static makeContext(Map) returning IContext.","Check plugin initialization requirements (ports free, netty version compatible)."],"exampleFix":"// before\nconf.put(Config.STORM_MESSAGING_TRANSPORT, \"com.me.MyTransportCtx\"); // class not on classpath\n// after\nconf.put(Config.STORM_MESSAGING_TRANSPORT, \"backtype.storm.messaging.netty.Context\");\n// or ship the custom plugin jar with the topology / into storm's lib directory","handlingStrategy":"try-catch","validationCode":"// preflight: load and instantiate the plugin before running the topology\nString cls = (String) conf.get(Config.STORM_MESSAGING_TRANSPORT);\nClass.forName(cls).getDeclaredConstructor().newInstance(); // throws early with a clear error","typeGuard":null,"tryCatchPattern":"try {\n    IContext ctx = TransportFactory.makeContext(stormConf);\n} catch (RuntimeException e) {\n    log.error(\"Transport plugin \" + stormConf.get(Config.STORM_MESSAGING_TRANSPORT)\n        + \" failed to initialize; check cause\", e.getCause());\n    throw e;\n}","preventionTips":["Keep the default netty Context unless you truly need a custom transport.","Ship custom transport jars to every node's storm lib or with the topology.","Test the plugin standalone with a small makeContext(Map) harness before cluster deploy.","Always inspect the 'Caused by' chain — the root failure is wrapped."],"tags":["messaging","reflection","plugin-loading","storm"],"backgroundTag":"module-init-failed","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"}