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

  1. Confirm all pinpoint-bootstrap* jars come from one identical Pinpoint release; replace mismatched jars
  2. Check the exception's cause for NoSuchMethodException (constructor missing) vs InvocationTargetException (constructor threw)
  3. If you shade/rebuild the agent, keep the ModuleSupportFactory public no-arg constructor intact
  4. 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

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


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/10def139910ecbb5. Report an issue: GitHub.