Debugging a game with Eclipse

I am trying to debug a Play application using Eclipse. First I run it with Run As: Application.launch

It seems to work.

Then I try to connect the debugger using Debug As: Connect JPDA to Application.launch

and I get an error:

 "Failed to connect to remote VM. Connection refused. Connection refused: connect" 

Any idea how to make this work?

+4
source share
5 answers

As indicated in another answer, the error you get is exactly the same as you when you try to connect the debugger a second time when it is already connected.

At the same time, if this does not explain your case, look at this line when you first start the application through Run As --> Application.launch :

Listening to the dt_socket transport at: 8000

It tells you on which port it is listening for possible JPDA connections, and if this line is missing, something is wrong. You can change the configuration of Application.launch manually (look at the address parameter of the -Xrunjdwp parameter passed to the Java virtual machine) and change the port if necessary. If you make changes, you also need to update the Connect JPDA to Application.launch launch configuration.

In any case, this is my suggestion - make sure that the application really listens for possible debugger connections and try changing the port that is used for this purpose.

+4
source

Make sure your application mode is set to dev in the conf / application.conf file: application.mode = DEV

Launch the application and you will see the following: Listening to the dt_socket transport at: 8000

Right-click on the "Connect JPDA .." and "Debug" panel as "Connect JPDA ..."

+2
source

I got this error in the past when I forgot that the debugger is already connected. Perhaps this is launched differently? Is it also possible that debugging is disabled in app.conf? Just a few things I would check.

I always start from the command line and debug from Eclipse, it may also cost a tray. Also try running in test mode if you haven’t.

0
source

Turn off everything and run it again. What happens is that when you debug, it shows nothing to you, and you may think that nothing is happening. You get this error because you can try several times, and you do not know that it is already running.

0
source

First, you must start the game from a console that does not start. Then run the debugger as.

-1
source

Source: https://habr.com/ru/post/1380457/


All Articles