{"record":{"id":"d994f013c5ca7aa7","repo":"apache/dubbo","slug":"protocol-not-found-id","errorCode":null,"errorMessage":"Protocol not found: <id>","messagePattern":"Protocol not found: <id>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java","lineNumber":263,"sourceCode":"    protected void convertProtocolIdsToProtocols() {\n        if (StringUtils.isEmpty(protocolIds)) {\n            if (CollectionUtils.isEmpty(protocols)) {\n                List<ProtocolConfig> protocolConfigs = getConfigManager().getDefaultProtocols();\n                if (CollectionUtils.isEmpty(protocolConfigs)) {\n                    throw new IllegalStateException(\"The default protocol has not been initialized.\");\n                }\n                setProtocols(protocolConfigs);\n            }\n        } else {\n            String[] idsArray = COMMA_SPLIT_PATTERN.split(protocolIds);\n            Set<String> idsSet = new LinkedHashSet<>(Arrays.asList(idsArray));\n            List<ProtocolConfig> tmpProtocols = new ArrayList<>();\n            for (String id : idsSet) {\n                Optional<ProtocolConfig> globalProtocol = getConfigManager().getProtocol(id);\n                if (globalProtocol.isPresent()) {\n                    tmpProtocols.add(globalProtocol.get());\n                } else {\n                    throw new IllegalStateException(\"Protocol not found: \" + id);\n                }\n            }\n            setProtocols(tmpProtocols);\n        }\n    }\n\n    public Class<?> getInterfaceClass() {\n        if (interfaceClass != null) {\n            return interfaceClass;\n        }\n        if (ref instanceof GenericService) {\n            return GenericService.class;\n        }\n        try {\n            if (StringUtils.isNotEmpty(interfaceName)) {\n                interfaceClass = Class.forName(\n                        interfaceName, true, Thread.currentThread().getContextClassLoader());\n            }","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java#L245-L281","documentation":"Thrown by ServiceConfigBase.convertProtocolIdsToProtocols when a specific protocol id (from the comma-separated protocolIds) cannot be found in the config manager. Each referenced id must resolve to a registered ProtocolConfig.","triggerScenarios":"protocolIds is non-empty and is split into ids, but getConfigManager().getProtocol(id) returns an empty Optional for at least one id.","commonSituations":"Typo in a protocol id in dubbo.protocol.ids or @DubboService(protocol=...). Protocol bean defined with a different id than referenced. ProtocolConfig registered in a different scope/module than the service. Removed a protocol bean but kept references to its id.","solutions":["Correct the protocol id to match an existing registered ProtocolConfig's id.","Register the missing ProtocolConfig bean/property with the expected id in the same scope.","Remove the stale id from protocolIds if that protocol is no longer needed."],"exampleFix":"// before\n@DubboService(protocol = \"dubbo,rst\") // typo: should be 'rest'\n\n// after\n@DubboService(protocol = \"dubbo,rest\")","handlingStrategy":"validation","validationCode":"// Validate every protocol id resolves before export\nfor (String id : serviceConfig.getProtocolIds().split(\",\")) {\n    if (!configManager.getProtocol(id.trim()).isPresent()) {\n        throw new IllegalStateException(\"Unknown protocol id: \" + id.trim()\n            + \"; register it first\");\n    }\n}\nserviceConfig.export();","typeGuard":null,"tryCatchPattern":"try {\n    serviceConfig.export();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Protocol not found: \")) {\n        // correct the protocol id or register the missing ProtocolConfig, then retry\n    }\n    throw e;\n}","preventionTips":["Double-check protocol ids against registered ProtocolConfig ids.","Register protocols in the same scope/module as the service.","Use configuration validation at startup to fail fast on bad ids."],"tags":["service-config","protocol","validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}