- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to resolve the error "java.net.ConnectException: Connection refused:"
Hi,
I am very new to the application 'Monitoring of Java Virtual Machines with JMX' and also to JMX concept. For installation and other configuration steps, I go through the below site:
https://splunkbase.splunk.com/app/668/#/details
I have done modifications only in the config.xml file with my localhost as hostname and its corresponding port details. Then created a data input through 'JMX' by entering necessary details. When I check for the index or sourcetype which I specified in the data input, no results are returned. When I check in the splunkd.log, it is writing the error as "java.net.ConnectException: Connection refused:"
I am able to connect to the host through jconsole without any issues. But when I configure the same details in the config file, it is unable to connect to the host.
Note: I have made changes only on config.xml file only added hostname and its port.
Could you let me know if anything I am missing to configure. Please help on this.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I would check your firewalls, that is the reason I see most often for that error message.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Damien,
I have turned off the windows firewall completely in my system. But still throwing the below error;
11-27-2017 14:55:39.385 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\SPLUNK4JMX\bin\jmx.py"" host=localhost, jmxServiceURL=, jmxport=0, jvmDescription=test, processID=0,stanza=jmx://testjmx,systemErrorMessage="Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
11-27-2017 14:55:39.385 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\SPLUNK4JMX\bin\jmx.py"" java.net.ConnectException: Connection refused: connect]"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Does "localhost" resolve correctly? Try 127.0.0.1
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Damien,
I have tried with 127.0.0.1, still I am getting the same error on splunkd log.
11-28-2017 11:05:30.541 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\SPLUNK4JMX\bin\jmx.py"" host=127.0.0.1, jmxServiceURL=, jmxport=0, jvmDescription=test, processID=0,stanza=jmx://testjmx,systemErrorMessage="Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
11-28-2017 11:05:30.541 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\SPLUNK4JMX\bin\jmx.py"" java.net.ConnectException: Connection refused: connect]"
I have also made the below changes but no luck.
mbean domain="" properties="" dumpAllAttributes="true"
Could you please help me on this.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Damien,
I have reinstalled the complete setup once again and updated only the config.xml file with the hostname and port details. Now I am getting the below error as failed to initialize the stanza.
ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\SPLUNK4JMX\bin\jmx.py"" The root config object(JMXPoller) failed to initialize, stanza : jmx://helloworld
Could you please help me on this. Due to this I am unable to proceed further on this setup.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The only times I've ever seen that error are when the user has a typo or misconfiguration in the config xml file. The xsd is shipped with the app if you need to validate your config.xml.
