简体   繁体   中英

Cannot connect to the remote server via Intellij for debug

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM