apache/dubbo · error · IllegalArgumentException
No activate extensions for [${type}] found
Error message
No activate extensions for [${type}] found What it means
Thrown by ExtensionAccessor.getFirstActivateExtension(type) when an ExtensionLoader exists for the type but getActivateExtensions() returns an empty list — meaning no extensions with matching @Activate conditions are currently active. The loader was found, but no implementation is eligible given the current activation criteria (URL, group, key, values).
Source
Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionAccessor.java:61
default <T> T getDefaultExtension(Class<T> type) {
ExtensionLoader<T> extensionLoader = getExtensionLoader(type);
return extensionLoader != null ? extensionLoader.getDefaultExtension() : null;
}
default <T> List<T> getActivateExtensions(Class<T> type) {
ExtensionLoader<T> extensionLoader = getExtensionLoader(type);
return extensionLoader != null ? extensionLoader.getActivateExtensions() : Collections.emptyList();
}
default <T> T getFirstActivateExtension(Class<T> type) {
ExtensionLoader<T> extensionLoader = getExtensionLoader(type);
if (extensionLoader == null) {
throw new IllegalArgumentException("ExtensionLoader for [" + type + "] is not found");
}
List<T> extensions = extensionLoader.getActivateExtensions();
if (extensions.isEmpty()) {
throw new IllegalArgumentException("No activate extensions for [" + type + "] found");
}
return extensions.get(0);
}
default Set<String> getSupportedExtensions(Class<?> type) {
ExtensionLoader<?> extensionLoader = getExtensionLoader(type);
return extensionLoader != null ? extensionLoader.getSupportedExtensions() : Collections.emptySet();
}
}
View on GitHub (pinned to 3a3043227f)
Solutions
- Check the SPI config files (META-INF/dubbo/<interface>) for the type — ensure at least one implementation is annotated with @Activate.
- Verify the @Activate annotation's group/key/value on the implementation matches the runtime context (PROVIDER vs CONSUMER).
- If you just need any extension (not an activate-matched one), use getExtension(type, name) or getDefaultExtension(type) instead.
- Use getActivateExtensions(type) which returns an empty list rather than throwing, then check isEmpty().
Example fix
// before
Filter f = accessor.getFirstActivateExtension(Filter.class); // empty -> throws
// after
List<Filter> filters = accessor.getActivateExtensions(Filter.class);
if (!filters.isEmpty()) {
Filter f = filters.get(0);
} else {
// handle: no matching @Activate filters
} Defensive patterns
Strategy: fallback
Validate before calling
List<?> exts = accessor.getActivateExtensions(type);
if (exts.isEmpty()) {
// no matching @Activate extension — use named/default instead
return accessor.getDefaultExtension(type);
} Type guard
static boolean hasActivateExtensions(ExtensionAccessor accessor, Class<?> type) {
return !accessor.getActivateExtensions(type).isEmpty();
} Try / catch
try {
return accessor.getFirstActivateExtension(type);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("No activate extensions")) {
return accessor.getDefaultExtension(type);
} else throw e;
} Prevention
- Use getActivateExtensions(type) and check isEmpty() instead of getFirstActivateExtension.
- Ensure at least one implementation is annotated @Activate with matching group/key.
- Verify SPI config files are present on the classpath.
When it happens
Trigger: Calling getFirstActivateExtension(type) on a valid SPI interface that has no @Activate-annotated extensions, or whose @Activate-annotated extensions do not match the current activation context (wrong @Activate group, key, or value filters).
Common situations: Querying for activated filter or wrapper extensions that exist in the SPI config but whose @Activate(group=...) annotation doesn't match the current provider/consumer context. Also happens when the SPI config files are empty or contain only non-activate extensions. Common after upgrading when an extension's @Activate conditions changed.
Related errors
- ExtensionLoader for [${type}] is not found
- Unable to get ExtensionLoader for type: ${type.getName()}
- There is no merger to merge result.
- No such class name in {}
- Failed to compile class, cause: {}, class: {}, code: {} , s
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/becc55a8d3e81caa.
Report an issue: GitHub.