For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/integrations/guide/agent-failed-to-retrieve-rmiserver-stub.md. A documentation index is available at /llms.txt.

Agent failed to retrieve RMIServer stub

To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [email protected].

instance #kafka-localhost-<PORT_NUM> [ERROR]: 'Cannot connect to instance localhost:<PORT_NUM>. java.io.IOException: Failed to retrieve RMIServer stub

The Datadog Agent is unable to connect to the Kafka instance to retrieve metrics from the exposed mBeans over the RMI protocol.

Include the following JVM arguments when starting the Kafka instance to solve resolve this issue (required for Producer, Consumer, and Broker as they are all separate Java instances)

-Dcom.sun.management.jmxremote.port=<PORT_NUM> -Dcom.sun.management.jmxremote.rmi.port=<PORT_NUM>