Netflix/Hystrix · error · RuntimeException

${classSimpleName} implementation not able to be accessed: $

Error message

${classSimpleName} implementation not able to be accessed: ${implementingClass}

What it means

Plugin classes supplied through hystrix.plugin.<PluginSimpleName>.implementation are instantiated with Class.newInstance(), which enforces Java access rules: the class and its no-arg constructor must be public. IllegalAccessException is caught and rethrown as this RuntimeException naming the configured class.

Source

Thrown at hystrix-core/src/main/java/com/netflix/hystrix/strategy/HystrixPlugins.java:358

    private static <T> T getPluginImplementationViaProperties(Class<T> pluginClass, HystrixDynamicProperties dynamicProperties) {
        String classSimpleName = pluginClass.getSimpleName();
        // Check Archaius for plugin class.
        String propertyName = "hystrix.plugin." + classSimpleName + ".implementation";
        String implementingClass = dynamicProperties.getString(propertyName, null).get();
        if (implementingClass != null) {
            try {
                Class<?> cls = Class.forName(implementingClass);
                // narrow the scope (cast) to the type we're expecting
                cls = cls.asSubclass(pluginClass);
                return (T) cls.newInstance();
            } catch (ClassCastException e) {
                throw new RuntimeException(classSimpleName + " implementation is not an instance of " + classSimpleName + ": " + implementingClass);
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(classSimpleName + " implementation class not found: " + implementingClass, e);
            } catch (InstantiationException e) {
                throw new RuntimeException(classSimpleName + " implementation not able to be instantiated: " + implementingClass, e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(classSimpleName + " implementation not able to be accessed: " + implementingClass, e);
            }
        } else {
            return null;
        }
    }
    
    

    private static HystrixDynamicProperties resolveDynamicProperties(ClassLoader classLoader, LoggerSupplier logSupplier) {
        HystrixDynamicProperties hp = getPluginImplementationViaProperties(HystrixDynamicProperties.class, 
                HystrixDynamicPropertiesSystemProperties.getInstance());
        if (hp != null) {
            logSupplier.getLogger().debug(
                    "Created HystrixDynamicProperties instance from System property named "
                    + "\"hystrix.plugin.HystrixDynamicProperties.implementation\". Using class: {}", 
                    hp.getClass().getCanonicalName());
            return hp;
        }

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Make the strategy class public and give it a public no-arg constructor.
  2. If you must keep a singleton, keep getInstance() but leave the no-arg constructor public as well.
  3. For JPMS deployments, ensure the strategy's package is exported to the module loading Hystrix.

Example fix

// before
class MyStrategy extends HystrixMetricsPublisher { // package-private
    private MyStrategy() {}
}

// after
public class MyStrategy extends HystrixMetricsPublisher {
    public MyStrategy() {}
}
Defensive patterns

Strategy: validation

Validate before calling

Constructor<?> ctor = Class.forName(fqcn).getConstructor(); // must exist
if (!Modifier.isPublic(ctor.getModifiers()) || !Modifier.isPublic(cls.getModifiers())) {
    throw new IllegalStateException("Plugin class/constructor must be public: " + fqcn);
}

Prevention

When it happens

Trigger: The strategy class is package-private; the no-arg constructor is private or protected (e.g. a singleton pattern with a private constructor); a non-public class in a different package than Hystrix.

Common situations: Applying the 'private constructor + getInstance()' singleton idiom to a Hystrix strategy; strategies written as package-private helpers; Java 9+ modules that do not export the strategy's package.

Related errors


AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14). Data as JSON: /api/errors/deda07b162f3fd66. Report an issue: GitHub.