How to debug a program from IntelliJ?

Hi,
I created different remote debug configurations with different port but fail to debug the programs. The error messages of IntelliJ are below. Thank you.

11:19 Error running ‘localhost:8787’: Unable to open debugger port (localhost:8787): java.net.ConnectException “Connection refused: connect”

11:22 Error running ‘localhost:8180’: Unable to open debugger port (localhost:8180): java.io.IOException “handshake failed - connection prematurally closed”

11:24 Error running ‘localhost:8887’: Unable to open debugger port (localhost:8887): java.net.ConnectException “Connection refused: connect”

Remote Configuration
studio

I can run debug in IntelliJ with port 8887 now. intelliJ shows “Connected to the target VM, address: ‘localhost:8887’, transport: ‘socket’”.

But I can’t open the login page by Chrome http://localhost:8887/app. It shows “can’t connect to web-site.”.

Hi,

The debug port and the application port is not the same thing. The default debug port is 8787, the default application port is 8080.

So, in your case, you should open http://localhost:8180/app in browser with the debugger connected to 8887.

Hi,
Thank you. It works now.