pinpoint-apm/pinpoint · error · PinpointException

${moduleFactoryClazzName} ModuleFactory initialize fail

Error message

${moduleFactoryClazzName} ModuleFactory initialize fail

What it means

DefaultModuleFactoryResolver.resolve() loads a ModuleFactory implementation by class name and instantiates it reflectively. Any ReflectiveOperationException is logged and rethrown as PinpointException('<factoryName> ModuleFactory initialize fail'). It indicates the configured module factory could not be created.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/DefaultModuleFactoryResolver.java:76

        return DEFAULT_MODULE_FACTORY.equals(moduleFactoryClazzName);
    }

    @Override
    public ModuleFactory resolve() {
        logger.info("{} ModuleFactory lookup", moduleFactoryClazzName);
        if (isDefaultModuleFactory(moduleFactoryClazzName)) {
            return new ApplicationContextModuleFactory();
        }

        ClassLoader classLoader = getClassLoader(DefaultModuleFactoryResolver.class.getClassLoader());
        try {
            final Class<? extends ModuleFactory> moduleFactoryClass =
                    (Class<? extends ModuleFactory>) Class.forName(moduleFactoryClazzName, true, classLoader);
            Constructor<? extends ModuleFactory> constructor = moduleFactoryClass.getConstructor();
            return constructor.newInstance();
        } catch (ReflectiveOperationException ex) {
            logger.warn("{} ModuleFactory initialize fail", moduleFactoryClazzName, ex);
            throw new PinpointException(moduleFactoryClazzName + " ModuleFactory initialize fail", ex);
        }
    }

    private ClassLoader getClassLoader(ClassLoader classLoader) {
        return Objects.requireNonNull(classLoader, "can't find classLoader");
    }

}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Correct the profiler.module.factory value (use the default factory FQCN shipped with the agent)
  2. If using a custom ModuleFactory, add its jar to the agent classpath and confirm the exact FQCN
  3. Ensure the factory class has a public no-arg constructor
  4. Check the logged WARN stack trace for the root ReflectiveOperationException cause

Example fix

// before
profiler.module.factory=com.mycompany.MyFactory  // jar not deployed
// after
profiler.module.factory=com.navercorp.pinpoint.profiler.context.module.DefaultModuleFactory
Defensive patterns

Strategy: validation

Validate before calling

String factory = System.getProperty("pinpoint.profiler.module.factory", "");
if (!factory.isEmpty()) {
    Class.forName(factory, true, agentClassLoader); // fails fast with clear ClassNotFoundException
}

Try / catch

try { ModuleFactory f = resolver.resolve(classLoader, factoryName); } catch (PinpointException e) { logger.error("ModuleFactory {} failed to initialize", factoryName, e.getCause()); }

Prevention

When it happens

Trigger: Configured profiler.module.factory class name cannot be found (Class.forName fails), has no no-arg constructor, the constructor is inaccessible, or newInstance() throws during construction.

Common situations: Typo in the profiler.module.factory config property, custom ModuleFactory jar missing from the agent classpath, or a custom factory whose constructor throws due to bad config.

Related errors


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