{"record":{"id":"becc55a8d3e81caa","repo":"apache/dubbo","slug":"no-activate-extensions-for-type-found","errorCode":null,"errorMessage":"No activate extensions for [${type}] found","messagePattern":"No activate extensions for \\[(.+?)\\] found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionAccessor.java","lineNumber":61,"sourceCode":"\n    default <T> T getDefaultExtension(Class<T> type) {\n        ExtensionLoader<T> extensionLoader = getExtensionLoader(type);\n        return extensionLoader != null ? extensionLoader.getDefaultExtension() : null;\n    }\n\n    default <T> List<T> getActivateExtensions(Class<T> type) {\n        ExtensionLoader<T> extensionLoader = getExtensionLoader(type);\n        return extensionLoader != null ? extensionLoader.getActivateExtensions() : Collections.emptyList();\n    }\n\n    default <T> T getFirstActivateExtension(Class<T> type) {\n        ExtensionLoader<T> extensionLoader = getExtensionLoader(type);\n        if (extensionLoader == null) {\n            throw new IllegalArgumentException(\"ExtensionLoader for [\" + type + \"] is not found\");\n        }\n        List<T> extensions = extensionLoader.getActivateExtensions();\n        if (extensions.isEmpty()) {\n            throw new IllegalArgumentException(\"No activate extensions for [\" + type + \"] found\");\n        }\n        return extensions.get(0);\n    }\n\n    default Set<String> getSupportedExtensions(Class<?> type) {\n        ExtensionLoader<?> extensionLoader = getExtensionLoader(type);\n        return extensionLoader != null ? extensionLoader.getSupportedExtensions() : Collections.emptySet();\n    }\n}\n","sourceCodeStart":43,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionAccessor.java#L43-L71","documentation":"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).","triggerScenarios":"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).","commonSituations":"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.","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()."],"exampleFix":"// before\nFilter f = accessor.getFirstActivateExtension(Filter.class); // empty -> throws\n\n// after\nList<Filter> filters = accessor.getActivateExtensions(Filter.class);\nif (!filters.isEmpty()) {\n    Filter f = filters.get(0);\n} else {\n    // handle: no matching @Activate filters\n}","handlingStrategy":"fallback","validationCode":"List<?> exts = accessor.getActivateExtensions(type);\nif (exts.isEmpty()) {\n    // no matching @Activate extension — use named/default instead\n    return accessor.getDefaultExtension(type);\n}","typeGuard":"static boolean hasActivateExtensions(ExtensionAccessor accessor, Class<?> type) {\n    return !accessor.getActivateExtensions(type).isEmpty();\n}","tryCatchPattern":"try {\n    return accessor.getFirstActivateExtension(type);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"No activate extensions\")) {\n        return accessor.getDefaultExtension(type);\n    } else throw e;\n}","preventionTips":["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."],"tags":["spi","extension-loader","activate","empty-result"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}