apache/dubbo · error · IllegalStateException
Extension name is blank (Extension ${type})!
Error message
Extension name is blank (Extension ${type})! What it means
Thrown by ExtensionLoader.addExtension(String name, Class<?> clazz) when the class is not annotated @Adaptive and the name argument is null or blank. Non-adaptive extensions require a unique non-blank name so they can be looked up by name later. Only adaptive classes (annotated @Adaptive) can be registered with a null name.
Source
Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java:662
*
* @param name extension name
* @param clazz extension class
* @throws IllegalStateException when extension with the same name has already been registered.
*/
public void addExtension(String name, Class<?> clazz) {
checkDestroyed();
getExtensionClasses(); // load classes
if (!type.isAssignableFrom(clazz)) {
throw new IllegalStateException("Input type " + clazz + " doesn't implement the Extension " + type);
}
if (clazz.isInterface()) {
throw new IllegalStateException("Input type " + clazz + " can't be interface!");
}
if (!clazz.isAnnotationPresent(Adaptive.class)) {
if (StringUtils.isBlank(name)) {
throw new IllegalStateException("Extension name is blank (Extension " + type + ")!");
}
if (cachedClasses.get().containsKey(name)) {
throw new IllegalStateException("Extension name " + name + " already exists (Extension " + type + ")!");
}
cachedNames.put(clazz, name);
cachedClasses.get().put(name, clazz);
} else {
if (cachedAdaptiveClass != null) {
throw new IllegalStateException("Adaptive Extension already exists (Extension " + type + ")!");
}
cachedAdaptiveClass = clazz;
}
}
/**
* Replace the existing extension via APIView on GitHub (pinned to 3a3043227f)
Solutions
- Provide a non-blank, unique name as the first argument to addExtension.
- If the name is computed dynamically, validate it is non-blank before calling addExtension.
- If registering an adaptive class, ensure it is annotated with @Adaptive.
Example fix
// before
loader.addExtension(null, MyImpl.class);
// after
loader.addExtension("myImpl", MyImpl.class); Defensive patterns
Strategy: validation
Validate before calling
if (!clazz.isAnnotationPresent(Adaptive.class) && StringUtils.isBlank(name)) {
throw new IllegalStateException(
"Extension name required for non-adaptive class " + clazz);
}
loader.addExtension(name, clazz); Prevention
- Always provide a non-blank, descriptive name for non-adaptive extension registrations.
- Generate names from the class simple name if a natural name is not available.
- Validate name is non-blank before calling addExtension.
When it happens
Trigger: Calling addExtension(null, ConcreteImpl.class) or addExtension(" ", ConcreteImpl.class) where ConcreteImpl is not @Adaptive. The name is what consumers use to select this extension via getExtension(name), so it must be meaningful and non-empty.
Common situations: Developer forgets to specify a name when programmatically registering a test extension. A helper method that wraps addExtension passes a computed name that happens to be null or empty.
Related errors
- Extension name is blank (Extension {})!
- Input type ${clazz} doesn't implement the Extension ${type}
- Input type ${clazz} can't be interface!
- Extension name ${name} already exists (Extension ${type})!
- Adaptive Extension already exists (Extension ${type})!
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/f3c591d77ee7caaa.
Report an issue: GitHub.