{"record":{"id":"94325732befec3e6","repo":"apache/dubbo","slug":"config-key-null","errorCode":null,"errorMessage":"<config>.<key> == null","messagePattern":"<config>\\.<key> == null","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java","lineNumber":245,"sourceCode":"                    if (value != null && str.length() > 0) {\n                        if (asParameters && parameter != null && parameter.escaped()) {\n                            str = URL.encode(str);\n                        }\n                        if (parameter != null && parameter.append()) {\n                            String pre = parameters.get(key);\n                            if (pre != null && pre.length() > 0) {\n                                str = pre + \",\" + str;\n                                // Remove duplicate values\n                                Set<String> set = StringUtils.splitToSet(str, ',');\n                                str = StringUtils.join(set, \",\");\n                            }\n                        }\n                        if (prefix != null && prefix.length() > 0) {\n                            key = prefix + \".\" + key;\n                        }\n                        parameters.put(key, str);\n                    } else if (asParameters && parameter != null && parameter.required()) {\n                        throw new IllegalStateException(config.getClass().getSimpleName() + \".\" + key + \" == null\");\n                    }\n                } else if (isParametersGetter(method)) {\n                    Map<String, String> map = (Map<String, String>) method.invoke(config);\n                    map = convert(map, prefix);\n                    if (asParameters) {\n                        // put all parameters to url\n                        parameters.putAll(map);\n                    } else {\n                        // encode parameters to string for config overriding, see AbstractConfig#refresh()\n                        String key = calculatePropertyFromGetter(name);\n                        String encodeParameters = StringUtils.encodeParameters(map);\n                        if (encodeParameters != null) {\n                            parameters.put(key, encodeParameters);\n                        }\n                    }\n                } else if (isNestedGetter(config, method)) {\n                    Object inner = method.invoke(config);\n                    String fieldName = MethodUtils.extractFieldName(method);","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java#L227-L263","documentation":"Thrown by AbstractConfig.appendParameters0 when building URL parameters from a config bean: a getter annotated @Parameter(required = true) returned null or an empty string while asParameters is true. Dubbo refuses to build the URL because a mandatory attribute is unset.","triggerScenarios":"A config bean (ServiceConfig, ReferenceConfig, ProtocolConfig, RegistryConfig, etc.) has a field marked @Parameter(required=true) whose getter returns null/empty during URL assembly (export/reference startup). Example: a required attribute like 'interface' or a custom required parameter was never set.","commonSituations":"A required config property was not specified in application.properties/dubbo.properties/Spring XML. A programmatic config object was created without calling the setter for a required field. A property placeholder (${...}) for a required attribute failed to resolve.","solutions":["Read the message: '<ConfigClass>.<key> == null' names the exact config and attribute — set that property.","Provide the value in your config source (application.yml, dubbo.properties, or Spring XML) under the correct prefix/key.","If configuring programmatically, call the corresponding setter before export()/reference().","If the field should be optional, review whether @Parameter(required=true) is appropriate for your use case."],"exampleFix":"// before\nServiceConfig<GreetingService> svc = new ServiceConfig<>();\nsvc.setRef(new GreetingImpl());\n// interface never set -> required param null\nsvc.export();\n// after\nsvc.setInterface(GreetingService.class);\nsvc.export();","handlingStrategy":"validation","validationCode":"// before export/reference, ensure required params are set\nvoid assertRequired(ServiceConfig<?> svc) {\n    if (svc.getInterface() == null) throw new IllegalStateException(\"interface required\");\n    // add checks for any @Parameter(required=true) fields you rely on\n}","typeGuard":null,"tryCatchPattern":"try {\n    serviceConfig.export();\n} catch (IllegalStateException e) {\n    if (e.getMessage().endsWith(\" == null\")) { /* set the named required attribute */ }\n    throw e;\n}","preventionTips":["Set all @Parameter(required=true) attributes before export/reference.","Add a config self-test that asserts required fields are non-null at startup.","Validate that property placeholders resolve for required attributes."],"tags":["config","startup","required-parameter","url-parameters"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}