{"record":{"id":"d95b64452c1d1d21","repo":"apache/dubbo","slug":"system-property-s-does-not-define-in-org-apache","errorCode":null,"errorMessage":"System property [%s] does not define in org.apache.dubbo.common.constants.CommonConstants","messagePattern":"System property \\[(.+?)\\] does not define in org\\.apache\\.dubbo\\.common\\.constants\\.CommonConstants","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/utils/SystemPropertyConfigUtils.java","lineNumber":62,"sourceCode":"                } catch (IllegalAccessException e) {\n                    throw new IllegalStateException(\n                            String.format(\"%s does not have field of %s\", clazz.getName(), field.getName()));\n                }\n            }\n        }\n    }\n\n    /**\n     * Return property of VM.\n     *\n     * @param key\n     * @return\n     */\n    public static String getSystemProperty(String key) {\n        if (containsKey(key)) {\n            return System.getProperty(key);\n        } else {\n            throw new IllegalStateException(String.format(\n                    \"System property [%s] does not define in org.apache.dubbo.common.constants.CommonConstants\", key));\n        }\n    }\n\n    /**\n     * Return property of VM. If not exist, the default value is returned.\n     *\n     * @param key\n     * @param defaultValue\n     * @return\n     */\n    public static String getSystemProperty(String key, String defaultValue) {\n        if (containsKey(key)) {\n            return System.getProperty(key, defaultValue);\n        } else {\n            throw new IllegalStateException(String.format(\n                    \"System property [%s] does not define in org.apache.dubbo.common.constants.CommonConstants\", key));\n        }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/SystemPropertyConfigUtils.java#L44-L80","documentation":"Thrown by SystemPropertyConfigUtils.getSystemProperty(String key) when key is not in the internal whitelist of known Dubbo system properties. The whitelist is built at class-init from CommonConstants.SystemProperty, ThirdPartyProperty, and DubboProperty inner classes. This is a guardrail that prevents arbitrary System.getProperty lookups through Dubbo's utility, not a missing-property error.","triggerScenarios":"Calling getSystemProperty(\"my.custom.key\") where the key is not a String constant in any of the three CommonConstants inner classes. Even if the system property exists on the JVM, the method rejects unknown keys.","commonSituations":"Migrating from System.getProperty to this utility for a property that was never registered in CommonConstants; typo in a known property name; new Dubbo property not yet added to the whitelist constant.","solutions":["Check CommonConstants.SystemProperty / ThirdPartyProperty / DubboProperty for the exact constant string and use that value.","If the property is genuinely custom, use System.getProperty(key) directly instead of this utility.","Add the property constant to the appropriate CommonConstants inner class if it should be Dubbo-managed."],"exampleFix":"// before\nString v = SystemPropertyConfigUtils.getSystemProperty(\"dubbo.application.name\");\n// rejected if the constant is registered under a different string\n\n// after\n// use the canonical constant\nString v = SystemPropertyConfigUtils.getSystemProperty(\n    CommonConstants.DubboProperty.DUBBO_APPLICATION_NAME);","handlingStrategy":"validation","validationCode":"// Check if the key is in the Dubbo whitelist before calling\n// Keys are String constants in CommonConstants.SystemProperty, .ThirdPartyProperty, .DubboProperty\n// For non-whitelisted keys, use System.getProperty(key) directly","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always reference the canonical constant from CommonConstants rather than hardcoding the key string.","Use System.getProperty() directly for custom or non-Dubbo properties."],"tags":["system-property","whitelist","configuration","dubbo-common"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}