Netflix/Hystrix · error · RuntimeException
${classSimpleName} implementation not able to be instantiate
Error message
${classSimpleName} implementation not able to be instantiated: ${implementingClass} What it means
After loading a plugin class named by hystrix.plugin.<PluginSimpleName>.implementation, Hystrix instantiates it with Class.newInstance(), which requires a public no-arg constructor and a concrete class. InstantiationException (abstract class, interface, or no default constructor) is rethrown as this RuntimeException.
Source
Thrown at hystrix-core/src/main/java/com/netflix/hystrix/strategy/HystrixPlugins.java:356
@SuppressWarnings("unchecked")
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());View on GitHub (pinned to 5ce3bc58c3)
Solutions
- Add a public no-argument constructor to the strategy class.
- If the class is abstract, configure a concrete subclass instead.
- Move the class to a top-level or static nested class if it is a non-static inner class.
Example fix
// before
public class MyStrategy extends HystrixPropertiesStrategy {
public MyStrategy(Config cfg) { ... } // no no-arg ctor -> InstantiationException
}
// after
public class MyStrategy extends HystrixPropertiesStrategy {
public MyStrategy() { this(defaultConfig()); }
public MyStrategy(Config cfg) { ... }
} Defensive patterns
Strategy: validation
Validate before calling
Class<?> cls = Class.forName(fqcn);
int modifiers = cls.getModifiers();
if (Modifier.isAbstract(modifiers) || cls.isInterface()) {
throw new IllegalStateException("Configured plugin is abstract/interface: " + fqcn);
}
cls.getConstructor(); // NoSuchMethodException if no no-arg ctor Try / catch
try {
pluginClass.getDeclaredConstructor().newInstance();
} catch (ReflectiveOperationException e) {
// surface as configuration error naming the property and class
} Prevention
- Always give strategy classes a public no-arg constructor.
- Add an ArchUnit/reflection test asserting configured plugin classes are concrete and instantiable.
When it happens
Trigger: The configured class is abstract or an interface; the class has only constructors with arguments and no public no-arg constructor; the class is a non-static inner class whose implicit constructor needs an outer instance.
Common situations: Registering an abstract base strategy 'for convenience'; a strategy whose constructor takes configuration parameters with no nullary overload; Kotlin/Scala strategy classes whose primary constructor has parameters and no @JvmOverloads no-arg variant.
Related errors
- ${classSimpleName} implementation is not an instance of ${cl
- ${classSimpleName} implementation class not found: ${impleme
- ${classSimpleName} implementation not able to be accessed: $
- Unsupported type {}
- method with name '{}' doesn't exist in class '{}'
AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14).
Data as JSON: /api/errors/f21d9d489caac22e.
Report an issue: GitHub.