{"record":{"id":"6a65edb20f2d03c5","repo":"apache/cassandra","slug":"use-of-com-sun-management-jmxremote-port-at-startu","errorCode":null,"errorMessage":"Use of com.sun.management.jmxremote.port at startup is deprecated. Please use cassandra.jmx.remote.port instead.","messagePattern":"Use of com\\.sun\\.management\\.jmxremote\\.port at startup is deprecated\\. Please use cassandra\\.jmx\\.remote\\.port instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":578,"sourceCode":"        }\n    };\n\n    public static final StartupCheck checkJMXProperties = new StartupCheck()\n    {\n        @Override\n        public String name()\n        {\n            return \"jmx_properties\";\n        }\n\n        @Override\n        public void execute(StartupChecksConfiguration configuration)\n        {\n            if (configuration.isDisabled(name()))\n                return;\n            if (COM_SUN_MANAGEMENT_JMXREMOTE_PORT.isPresent())\n            {\n                logger.warn(\"Use of com.sun.management.jmxremote.port at startup is deprecated. \" +\n                            \"Please use cassandra.jmx.remote.port instead.\");\n            }\n        }\n    };\n\n    public static final StartupCheck inspectJvmOptions = new StartupCheck()\n    {\n        @Override\n        public String name()\n        {\n            return \"jvm_options\";\n        }\n\n        @Override\n        public void execute(StartupChecksConfiguration configuration)\n        {\n            if (configuration.isDisabled(name()))\n                return;","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L560-L596","documentation":"A WARN log (not an exception) from the deprecation check inspectComSunManagementJmxRemotePort's execute(). Setting the raw JVM property com.sun.management.jmxremote.port to enable JMX is deprecated in Cassandra; configuration of the JMX server moved to jmx_server_options in cassandra.yaml, and the Cassandra-specific system property cassandra.jmx.remote.port is the supported flag. The legacy setting still works but is flagged for removal.","triggerScenarios":"inspectComSunManagementJmxRemotePort.execute() runs at startup while the JVM system property com.sun.management.jmxremote.port is present (e.g. via -Dcom.sun.management.jmxremote.port=7199 in jvm-server.options or JAVA_OPTS).","commonSituations":"Deployments carrying over pre-jmx_server_options JVM flags; Helm charts / docker images injecting JMX_PORT via legacy properties; docs or monitoring setups written for older Cassandra versions.","solutions":["Remove -Dcom.sun.management.jmxremote.port from JVM options and configure JMX via jmx_server_options in cassandra.yaml (enabled/remote/jmx_port)","If a system property is required for your tooling, use cassandra.jmx.remote.port instead of com.sun.management.jmxremote.port","Restart and confirm the deprecation warning is gone and JMX binds to the expected port"],"exampleFix":"// before (jvm-server.options)\n-Dcom.sun.management.jmxremote.port=7199\n\n// after (cassandra.yaml)\njmx_server_options:\n  enabled: true\n  remote: true\n  jmx_port: 7199","handlingStrategy":"validation","validationCode":"// Pre-flight: detect legacy JMX port property before starting the JVM\nif (System.getProperty(\"com.sun.management.jmxremote.port\") != null)\n    System.out.println(\"WARNING: com.sun.management.jmxremote.port is deprecated; use jmx_server_options in cassandra.yaml or cassandra.jmx.remote.port\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit jvm-server.options and JAVA_OPTS for com.sun.management.jmxremote.* during upgrades","Centralize JMX config in cassandra.yaml jmx_server_options","Use cassandra.jmx.remote.port if a system property is unavoidable","Add a config-lint rule that flags legacy jmxremote properties in deployment templates"],"tags":["jmx","deprecation","jvm-properties","configuration","cassandra-yaml"],"backgroundTag":"deprecated-api-usage","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}