Eclipse Error: "Could not connect to the remote virtual machine"

I get the following error when starting Debug from the Eclipse IDE.

Message: "Failed to connect to remote VM. Connection Refused"

What could be the reason?

+42
java eclipse
Jun 10 '09 at 12:54
source share
30 answers

Have you installed a remote virtual machine to accept connections?

 java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=10000,suspend=n yourServer 

Is there a firewall?

Are you specifying the correct host / port?

Are you connected to a VPN?

+25
Jun 10 '09 at 12:58
source share

Remove proxy from eclipse!

Go to the network connections in the "General Settings" (Windows → "Settings") and set "Active Provider" to "Direct"

remove proxy

Reboot your Eclipse after this

+17
Jul 29 '14 at 17:43
source share

add script to your run:

 export JPDA_ADDRESS=8787 export JPDA_TRANSPORT=dt_socket export JPDA_HOST=localhost JAVA_OPTS=$JAVA_OPTS -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 JAVA_OPTS=$JAVA_OPTS -Dsun.rmi.dgc.server.gcInterval=3600000 JAVA_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n $JAVA_OPTS 
+2
Apr 22 '10 at 2:00
source share

In our development image, the Tomcat service installation is installed on it, therefore setting environment variables, etc. had no effect. If you need to do this through the Tomcat Windows service, you need to know a few things:

  • David Citron's comment is the last bit I need to make my connection work. The hosts file on our computers commented on localhost (it is supposedly resolved through DNS, but this does not work for a debugging connection). I uncommented it and was able to connect.
  • If user access control is enabled, you need to use administrator credentials to access the services control panel or Tomcat monitoring application or what you use to switch server status. The monitor application (registered here ) is probably the best because you can edit the server settings for debugging options and start and stop the server.
  • I thought you might need to run Eclipse as an administrator in order to be able to complete the Tomcat process, but you won’t. When you have this remote application, you can work with the service until completion.
+2
Apr 26 '10 at 18:28
source share

David Citron is right - if the local host does not resolve correctly, this may cause this problem. Here's how to check:

If it works when your computer is not connected to the network (no Wi-Fi, no network cables). If it works under these conditions, you may need to make sure that the addresses match localhost correctly. Messages that DDMS and adb.exe use to debug and communicate with the virtual machine must correctly resolve to localhost on your PC. (Yes, it’s strange that other commands using DDMS and adb work fine, but it doesn’t do debugging. It seems that something in DDMS or adb needs to be standardized so that they all work under the same conditions.)

If you need to make sure the localhost solution is correct:

1) Make sure this line is in the file /Windows/System32/drivers/etc/hosts :

  127.0.0.1 localhost

(you can have any number of spaces between "127.0.0.1" and "localhost")

And - as David Citron suggested - make sure the hosts file is valid and free from errors or errors.

2) If this does not work, you may also need to add the IPv4 address of your computer to the hosts file and allow it localhost . (You can find out the IPv4 address for your computer using the ipconfig command.) If, for example, your IPv4 computer address is 192.168.1.100 , you must add the line

 192.168.1.100 localhost

to your hosts file. (You can add it under the line "127.0.0.1 localhost" in the file.)

You can verify that adb (and your emulator, if you use it) is listening on ports using the netstat -b command. (Note that you need administrator privileges for the -b option. I open the command window using the "Run as administrator" command.)

+2
Jul 13 '12 at 3:10
source share

Note. A port can accept only one connection, and any subsequent connections will be rejected.

+2
Sep 06 '17 at 1:56 on
source share

Possible reason for this error:

  • Remote Java application does not work.
  • Check your host and port, many times these entries are incorrect.
  • The firewall does not allow access to your remote port.

You can also check this out as an eclipse remote debugging guide for more details.

+1
Nov 01 '11 at 4:13
source share

Check if you specified port 8080 incorrectly instead of 8000. This happened to me.

+1
Jul 09 '12 at 10:01
source share

The following worked for me: edit the last line of tomcat startup.sh from

 exec "$PRGDIR"/"$EXECUTABLE" start "$@"` 

to

 export JPDA_ADDRESS=8000 export JPDA_TRANSPORT=dt_socket exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@" 
+1
May 21 '14 at 8:27
source share

I right-clicked the debug perspective button and selected reset. He worked accordingly.

+1
Apr 23 '15 at 7:53
source share

I decided to install it in Eclipse:

 Windows --> Preferences --> Java --> Debug --> Debugger timeout: 10000 

Before I installed " Debugger timeout: 3000 " and I had problems with a timeout.

+1
Aug 31 '16 at 17:53
source share

I had and resolved this problem by disabling all remote Java applications in the debug / perspective window and restarting Eclipse. After that, I could connect again.

0
Jan 23 2018-12-23T00:
source share

Uninstall and reinstall the ADT android plugin.

0
Mar 05 2018-12-12T00:
source share

If you use windows os, then replace the line in the tomcat configuration Tomcat6\bin\startup.bat .

Replace

 call "%EXECUTABLE%" start %CMD_LINE_ARGS% 

from

 call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% 
0
Apr 19 '13 at 7:36 on
source share

If you need to debug an application that works with Tomcat, make sure that your Tomcat folder / bin / startup.bat (if using Windows) contains the following lines:

 set JPDA_TRANSPORT="dt_socket" set JPDA_ADDRESS=8000 call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% 
0
Sep 12 '13 at 22:30
source share

I had a problem with Tomcat running on Ubuntu. The problem was with selinux, and for some reason, it would not allow Eclipse to connect to the debug port. Disabling selinux or enabling it in resolving mode solved the problem for me.

0
Jan 23 '14 at 1:14
source share

I get this error for Weblogic after installing Quicktime and uninstalling QTJava.zip from the classpath method solves the problem.

https://blogs.oracle.com/adfjdev/entry/java_jre7_lib_ext_qtjava

0
Feb 07 '14 at 7:17
source share

Increase property memory value

  • MEM_PERM_SIZE_64BIT
  • MEM_MAX_PERM_SIZE_64BIT

in setDomainEnv.cmd file from %weblogic_home%\user_projects\domains\your_domain\bin

0
Feb 18 '14 at 18:39
source share

I will add another possible solution if you use it in a virtual machine (vmware, etc.), some other processes on the host or other virtual machine may already have the port you are trying to connect to, Either stop this other process, or select a different port.

0
Apr 25
source share

The solution that worked for me was weird

  • Just delete all breakpoints
  • Restart tomcat in debug mode (using Catalina.sh jpda launch)
  • Now try connecting and it worked !!!!
0
Sep 10 '14 at 6:23
source share

Create the setenv.bat file in the Tomcat nib folder. Add SET JPDA_ADDRESS = 8787; Override jpda port Open cmd, go to the Tomcat bin folder and start tomcat using Catalina jpda start Configure debug point on eclipse Then compile your project. Check localhost: 8080 / Deploy the war or pitcher in the webapps folder and this should deploy the war on Tomcat. Then send the request. delete debug point Do not edit the catalina.bat file. make changes to setenv.bat file

0
Nov 25 '14 at 7:17
source share

If you are using Jboss:

change the jboss7.1.1 \ bin \ standalone.conf.bat file line:

 rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" 

at

 set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" 
0
Apr 30 '15 at 9:52
source share

I tried a few things mentioned here, but the method below worked for me:

Go to the Eclipse debugging console, where you will find the name of the process that already exists. Right-click on this process and select "Finish and delete", this will complete the process. Now try to start the process again and it will work.

0
Feb 23 '16 at 11:02
source share

In my case, I turn on the Windows firewall off

1- Open the Windows Firewall by clicking on the “Start” button Picture of the “Start” button and then “Control Panel”. Enter a firewall in the search box and click "Windows Firewall."

2- Click Turn Windows Firewall On or Off. Administrator permission required. If you are prompted for an administrator password or confirmation, enter the password or submit a confirmation.

3- Click “Disable Windows Firewall (not recommended) in each network location that you want to stop trying to protect, and then click“ OK. ”Was this page helpful?

Several times you also need

  • To stop all Vpn client services (fortiClient, vpn Client ...)
  • To stop the anti-virus firewall (for example, Kaspersky => Configuration => Anti-Hacker)
0
Jun 03 '16 at 9:57
source share

I am using jboss, so the solution to your problem has been restarted.

 service jboss-portal restart 
0
Apr 12 '17 at 9:17 on
source share

make sure your application server is up and listening on the correct port.

0
Jul 03 '17 at 19:56 on
source share

I met like this in Hybris.

  • Check your port in Resource Monitor> Network. Check if another service is using your port.

1.2 If yes, then you need to change your properties in project.properties

1.3 Change your address, any available address. In my case, I changed from 8000 to 8080. Then save.

 java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8080,suspend=n yourServer 
  1. In the console console, open the ant command with the ant all command

  2. Then debug again using the "hybrisserver.bat debug" command

0
Jul 14 '17 at 2:26 on
source share

NOTE. To log in to Glassfish Server through the administrator console → Configurations → server-config → JVM settings. * Remember to check the Enable box for Debug. Now Pay attention to the address, this address will be used in the eclipse Remote Java Application Debug port. Here you can check the snap-snapshot on the server in the glass shop

0
Nov 27 '17 at 13:28
source share

Another possibility is that the debug agent is communicating with the wrong network interface.

I just saw this while trying to debug a Windows 10 virtual machine inside a virtual virtual machine, and I'm trying to connect to Eclipse running on a VirtualBox host. In my case, the agent is bound only to the 127.0.0.1 interface.

To fix, you can qualify the address , including the IP of the interface to which you want to bind. For example:

 java -agentlib:jdwp=transport=dt_socket,server=y,address=192.168.0.5:8000,suspend=n <other arguments> 
0
Nov 28 '17 at 13:49 on
source share

do not install jdk 7 .. uninstall your version of jdk 7 and install JDK 6 in any version with applets.

-12
Jan 10 '13 at 8:23
source share



All Articles