{"record":{"id":"10def139910ecbb5","repo":"pinpoint-apm/pinpoint","slug":"modulesupportfactory-initialize-fail","errorCode":null,"errorMessage":"ModuleSupportFactory() initialize fail","messagePattern":"ModuleSupportFactory\\(\\) initialize fail","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ModuleBootLoader.java","lineNumber":86,"sourceCode":"            throw new IllegalStateException(\"defineAgentPackage fail: Caused by:\" + ex.getMessage(), ex);\n        }\n    }\n\n\n    private Class<?> getModuleSupportFactoryClass(ClassLoader parentClassLoader) {\n        try {\n            return Class.forName(\"com.navercorp.pinpoint.bootstrap.java9.module.ModuleSupportFactory\", false, parentClassLoader);\n        } catch (ClassNotFoundException ex) {\n            throw new IllegalStateException(\"ModuleSupportFactory not found Caused by:\" + ex.getMessage(), ex);\n        }\n    }\n\n    private Object newModuleSupportFactory(Class<?> bootStrapClass) {\n        try {\n            Constructor<?> constructor = bootStrapClass.getDeclaredConstructor();\n            return constructor.newInstance();\n        } catch (ReflectiveOperationException e) {\n            throw new IllegalStateException(\"ModuleSupportFactory() initialize fail\", e);\n        }\n    }\n}\n","sourceCodeStart":68,"sourceCodeEnd":90,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ModuleBootLoader.java#L68-L90","documentation":"ModuleBootLoader.newModuleSupportFactory gets the no-arg declared constructor of the ModuleSupportFactory class and calls newInstance(). Any ReflectiveOperationException (NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException from the constructor) becomes IllegalStateException 'ModuleSupportFactory() initialize fail'.","triggerScenarios":"The resolved ModuleSupportFactory class has no accessible no-arg constructor, its constructor throws, or the class is abstract/an interface — normally caused by a mismatched or corrupted bootstrap-javaX jar.","commonSituations":"Mixed Pinpoint jar versions on the classpath (old ModuleSupportFactory signature with new boot code); a shaded/relocated jar where the constructor was made private; bytecode corruption from a bad build or truncated download.","solutions":["Confirm all pinpoint-bootstrap* jars come from one identical Pinpoint release; replace mismatched jars","Check the exception's cause for NoSuchMethodException (constructor missing) vs InvocationTargetException (constructor threw)","If you shade/rebuild the agent, keep the ModuleSupportFactory public no-arg constructor intact","Redownload/rebuild the distribution if the jar is truncated or corrupted"],"exampleFix":"// before\nprivate ModuleSupportFactory() { ... }\n// after\npublic ModuleSupportFactory() { ... }","handlingStrategy":"try-catch","validationCode":"Constructor<?> ctor = bootStrapClass.getDeclaredConstructor();\nif (!java.lang.reflect.Modifier.isPublic(ctor.getModifiers())) {\n    throw new IllegalStateException(\"ModuleSupportFactory needs a public no-arg constructor\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return ctor.newInstance();\n} catch (ReflectiveOperationException e) {\n    logger.error(\"ModuleSupportFactory init failed\", e);\n    throw e;\n}","preventionTips":["Preserve the public no-arg constructor in shaded builds","Validate downloaded jars with checksums","Keep the module bootstrap jars from one release"],"tags":["reflection","constructor","java-modules","jar"],"backgroundTag":"invalid-constructor-argument","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}