{"record":{"id":"32aff11d57b1ddf2","repo":"apache/dubbo","slug":"unable-to-get-extensionloader-for-type-type-get","errorCode":null,"errorMessage":"Unable to get ExtensionLoader for type: ${type.getName()}","messagePattern":"Unable to get ExtensionLoader for type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModelUtil.java","lineNumber":116,"sourceCode":"    }\n\n    public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> type, ScopeModel scopeModel) {\n        if (scopeModel != null) {\n            return scopeModel.getExtensionLoader(type);\n        } else {\n            SPI spi = type.getAnnotation(SPI.class);\n            if (spi == null) {\n                throw new IllegalArgumentException(\"SPI annotation not found for class: \" + type.getName());\n            }\n            switch (spi.scope()) {\n                case FRAMEWORK:\n                    return FrameworkModel.defaultModel().getExtensionLoader(type);\n                case APPLICATION:\n                    return ApplicationModel.defaultModel().getExtensionLoader(type);\n                case MODULE:\n                    return ApplicationModel.defaultModel().getDefaultModule().getExtensionLoader(type);\n                default:\n                    throw new IllegalArgumentException(\"Unable to get ExtensionLoader for type: \" + type.getName());\n            }\n        }\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModelUtil.java#L98-L121","documentation":"The default branch of the switch over spi.scope() inside getExtensionLoader(). SPI.Scope is a fixed enum (FRAMEWORK/APPLICATION/MODULE) and all values are cased, so this branch is only reachable if a new enum constant exists that this build does not recognize — i.e. a classpath with mismatched Dubbo versions where one module knows of a scope the common module does not.","triggerScenarios":"Same root cause as error 368: a SPI.Scope enum value not handled by the switch, only reached through the extension-loader path. Requires mixed/incompatible Dubbo artifact versions or a fork that added a scope constant without updating this switch.","commonSituations":"Dependency version conflicts across dubbo-* artifacts (e.g. dubbo-common older than dubbo-rpc). Shaded jars from different vendors. A custom Dubbo fork that extended SPI.Scope. Practically unreachable in a consistent-version deployment.","solutions":["Align all Dubbo artifact versions using dubbo-bom in dependencyManagement.","Inspect `mvn dependency:tree` for transitive dubbo-* jars at divergent versions and exclude/align them.","If forking Dubbo and adding a scope value, add a matching case to this switch.","Upgrade the conflicting module to the version of dubbo-common in use."],"exampleFix":"// not user-code; resolve dependency versions\n// before: dubbo-common 3.0.x + dubbo-rpc 3.2.x (new scope constant)\n// after: pin all to one version via dubbo-bom (see error 368 example)","handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"FRAMEWORK\", \"APPLICATION\", \"MODULE\");\nfor (SPI.Scope s : SPI.Scope.values()) {\n    if (!known.contains(s.name())) {\n        throw new IllegalStateException(\"Unsupported SPI.Scope \" + s + \" — align Dubbo versions\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin all Dubbo artifacts to a single version with dubbo-bom.","Audit dependency:tree for mismatched dubbo-* versions.","Do not mix vendor-shaded Dubbo jars."],"tags":["spi","extension-loader","version-conflict","dependency-management"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}