DEV Community

CoderLegion
CoderLegion

Posted on โ€ข Edited on โ€ข Originally published at kodblems.com

1

Failed to connect to remote vm. connection refused. connection refused: connect

๐ŸŽ‰ Before you dive into this article...

๐Ÿš€ Check out our vibrant new community at CoderLegion.com!

๐Ÿ’ก Share your knowledge, connect with like-minded developers, and grow together.

๐Ÿ‘‰ Click here to join now!

Problem :
I am often facing the below error when I want to Debug from my Eclipse IDE.

Message: โ€œFailed to connect to remote VM. Connection Refusedโ€
How can I fix this error?

Solution :
In my case, I had to turn my Windows Firewall off

1- Open your Windows Firewall by just clicking the Start button Picture of the Start button, and then clicking the Control Panel. In your search box, just type firewall, and after that click on Windows Firewall.

2- Now just click on Turn Windows Firewall on or off. The Administrator permission required If you are prompted for the administrator password or the confirmation, type your password or provide the confirmation.

3- Click on Turn off Windows Firewall (not recommended by me) under the each network location that you are trying to stop the protection, and after that click on OK.

Sometimes you need the below steps also

To stop all the Vpn client services (fortiClient ,vpn Client ...)
To stop all the Antivirus Firewall ( exemple Kaspersky => Configuration => Anti-Hacker)
OR

I am using the jboss so the solution to your problem is very simple just restart using the below command :

service jboss-portal restart

Another Solution:
In your debug configuration you'll have to identify the correct port of your server (GF:9009 / Tomcat:8000)

You'll have to place the JVM property of the server to debug

For Glassfish:

Log in to admin-console > Configurations > server-config > JVM-Settings > check DEBUG checkbox > restart server
For Tomcat:

make file debug.bat/.sh (depending on your OS) in %TOMCAT_HOME%/bin directory and write

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
catalina.bat jpda start
in it.

Afterward, you've made this file begin server by executing debug.bat/.sh.

Currently, you must be able to debug remotely in Eclipse after you fix the required properties in your debug configuration.

In case you're running tomcat in a Win environment as a service you don't have a catalina.bat file in the bin-directory of your tomcat installation.
For setting your server into debug-mode please attempt the following:

Run the Configuration option in Windows Menu or run
%catalina_home%/bin/tomcat6w.exe
In the Java tab, include this line to Java:
I hope this will help you

Image of Timescale

Timescale โ€“ the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

๐Ÿ‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Communityโ€”every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple โ€œthank youโ€ goes a long wayโ€”express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay