{"record":{"id":"9b90cb99315a4c94","repo":"alibaba/nacos","slug":"400-9b90cb","errorCode":"400","errorMessage":"properties is null","messagePattern":"properties is null","errorType":"exception","errorClass":"NacosException","httpStatus":null,"severity":"error","filePath":"maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/naming/NamingMaintainerFactory.java","lineNumber":54,"sourceCode":"     */\n    public static NamingMaintainerService createNamingMaintainerService(String serverList)\n        throws NacosException {\n        Properties properties = new Properties();\n        properties.setProperty(\"serverAddr\", serverList);\n        return new NacosNamingMaintainerServiceImpl(properties);\n    }\n    \n    /**\n     * create Naming maintainer service.\n     *\n     * @param properties properties\n     * @return naming maintainer service\n     * @throws NacosException nacos exception\n     */\n    public static NamingMaintainerService createNamingMaintainerService(Properties properties)\n        throws NacosException {\n        if (properties == null) {\n            throw new NacosException(NacosException.INVALID_PARAM, \"properties is null\");\n        }\n        return new NacosNamingMaintainerServiceImpl(properties);\n    }\n}\n","sourceCodeStart":36,"sourceCodeEnd":59,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/naming/NamingMaintainerFactory.java#L36-L59","documentation":"Thrown by NamingMaintainerFactory.createNamingMaintainerService(Properties) when the properties argument is null. This is the entry-point factory for the naming maintainer client; a null properties set means there is no server address, credentials, or timeout configuration to build the service from. Error code INVALID_PARAM=400.","triggerScenarios":"Calling NamingMaintainerFactory.createNamingMaintainerService(null) directly, or passing a Properties reference that was never instantiated (e.g. loaded from a config file that failed to parse).","commonSituations":"Loading properties from an external file or environment that was missing, leaving the Properties object null. Dependency injection misconfiguration where the Properties bean is not defined. Copy-pasting example code that omitted the properties construction step.","solutions":["Construct a Properties object with at minimum serverAddr set before calling the factory.","If loading properties from a file/env, fail fast with a clear error when the source is unavailable rather than passing null.","Use the overloaded factory variant that accepts a server address String if you do not need full Properties control."],"exampleFix":"// before\nNamingMaintainerService svc = NamingMaintainerFactory.createNamingMaintainerService(null);\n\n// after\nProperties props = new Properties();\nprops.setProperty(PropertyKeyConst.SERVER_ADDR, \"127.0.0.1:8848\");\nNamingMaintainerService svc = NamingMaintainerFactory.createNamingMaintainerService(props);","handlingStrategy":"validation","validationCode":"Properties props = new Properties();\nprops.setProperty(PropertyKeyConst.SERVER_ADDR, serverAddress);\nif (props.getProperty(PropertyKeyConst.SERVER_ADDR) == null) {\n    throw new IllegalStateException(\"serverAddr must be configured\");\n}\nNamingMaintainerService svc = NamingMaintainerFactory.createNamingMaintainerService(props);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always construct a new Properties() explicitly before passing to the factory.","Fail fast in your config-loading code if the properties source (file/env) is missing rather than passing null.","Use the String-based server-address factory overload when you only need to set the server address."],"tags":["validation","maintainer-client","null-check","factory","initialization"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}