Home > database >  Cannot connect to the remote server via Intellij for debug
Cannot connect to the remote server via Intellij for debug

Time:11-05

I have a remote Linux server and an application on it which I need to debug. I start the .jar file through the terminal in Intellij with line:

sudo java -Dspring.profiles.active=test -Dspring.config.additional-location=file:/.../external.properties -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar /.../JARFILE.jar

Jar file is started correctly, the application is working, but I cannot debug it remotely via IDEA with those settings: remote debugging configuration.

It throws an error saying "java.net.ConnectException: Connection timed out: connect." after a few seconds from I clicked the debug button.

What should I do?

CodePudding user response:

You say that you are unable to connect to the JVM via a debugger.

I'd expect that the reason for this error is the fact that you are not launching the JVM with the correct input arguments so that it can run in debug mode.

The easiest fix for this issue would be to allow IntelliJ to run it for you with correct configuration.

You say that you want to deploy the app to a remote server and debug it from there. Why not use this functionality in IntelliJ, which will guarantee that correct flags are set.

I think this value address=*:5005 might be wrong, try running it with address=5005

  • Related