apache/cassandra · warning

Use of com.sun.management.jmxremote.port at startup is depre

Error message

Use of com.sun.management.jmxremote.port at startup is deprecated. Please use cassandra.jmx.remote.port instead.

What it means

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.

Source

Thrown at src/java/org/apache/cassandra/service/StartupChecks.java:578

        }
    };

    public static final StartupCheck checkJMXProperties = new StartupCheck()
    {
        @Override
        public String name()
        {
            return "jmx_properties";
        }

        @Override
        public void execute(StartupChecksConfiguration configuration)
        {
            if (configuration.isDisabled(name()))
                return;
            if (COM_SUN_MANAGEMENT_JMXREMOTE_PORT.isPresent())
            {
                logger.warn("Use of com.sun.management.jmxremote.port at startup is deprecated. " +
                            "Please use cassandra.jmx.remote.port instead.");
            }
        }
    };

    public static final StartupCheck inspectJvmOptions = new StartupCheck()
    {
        @Override
        public String name()
        {
            return "jvm_options";
        }

        @Override
        public void execute(StartupChecksConfiguration configuration)
        {
            if (configuration.isDisabled(name()))
                return;

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove -Dcom.sun.management.jmxremote.port from JVM options and configure JMX via jmx_server_options in cassandra.yaml (enabled/remote/jmx_port)
  2. If a system property is required for your tooling, use cassandra.jmx.remote.port instead of com.sun.management.jmxremote.port
  3. Restart and confirm the deprecation warning is gone and JMX binds to the expected port

Example fix

// before (jvm-server.options)
-Dcom.sun.management.jmxremote.port=7199

// after (cassandra.yaml)
jmx_server_options:
  enabled: true
  remote: true
  jmx_port: 7199
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight: detect legacy JMX port property before starting the JVM
if (System.getProperty("com.sun.management.jmxremote.port") != null)
    System.out.println("WARNING: com.sun.management.jmxremote.port is deprecated; use jmx_server_options in cassandra.yaml or cassandra.jmx.remote.port");

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/6a65edb20f2d03c5. Report an issue: GitHub.