pinpoint-apm/pinpoint · critical · IllegalStateException
ModuleSupportFactory() initialize fail
Error message
ModuleSupportFactory() initialize fail
What it means
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'.
Source
Thrown at agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ModuleBootLoader.java:86
throw new IllegalStateException("defineAgentPackage fail: Caused by:" + ex.getMessage(), ex);
}
}
private Class<?> getModuleSupportFactoryClass(ClassLoader parentClassLoader) {
try {
return Class.forName("com.navercorp.pinpoint.bootstrap.java9.module.ModuleSupportFactory", false, parentClassLoader);
} catch (ClassNotFoundException ex) {
throw new IllegalStateException("ModuleSupportFactory not found Caused by:" + ex.getMessage(), ex);
}
}
private Object newModuleSupportFactory(Class<?> bootStrapClass) {
try {
Constructor<?> constructor = bootStrapClass.getDeclaredConstructor();
return constructor.newInstance();
} catch (ReflectiveOperationException e) {
throw new IllegalStateException("ModuleSupportFactory() initialize fail", e);
}
}
}
View on GitHub (pinned to 744c3d3075)
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
Example fix
// before
private ModuleSupportFactory() { ... }
// after
public ModuleSupportFactory() { ... } Defensive patterns
Strategy: try-catch
Validate before calling
Constructor<?> ctor = bootStrapClass.getDeclaredConstructor();
if (!java.lang.reflect.Modifier.isPublic(ctor.getModifiers())) {
throw new IllegalStateException("ModuleSupportFactory needs a public no-arg constructor");
} Try / catch
try {
return ctor.newInstance();
} catch (ReflectiveOperationException e) {
logger.error("ModuleSupportFactory init failed", e);
throw e;
} Prevention
- Preserve the public no-arg constructor in shaded builds
- Validate downloaded jars with checksums
- Keep the module bootstrap jars from one release
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- defineAgentPackage fail: Caused by:
- constructor not found
- moduleSupport load fail Caused by:
- Unknown CpuLoadMetric : {}
- Unknown FileDescriptorMetric : {}
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/10def139910ecbb5.
Report an issue: GitHub.