1
votes

I started the command "heroku ps:forward 9090 --app [app-name]". I added a "Remote" debug configuration in IntelliJ, and set host to "localhost" and port to "9090". I start the debugger, and after a while I get this message:

"Error running '[configuration name]': Unable to open debugger port (localhost:9090): java.io.IOException "handshake failed - connection prematurely closed".

I checked with netstat that port 9090 is actually listening for a connection.

1
Can you telnet to this port? - CrazyCoder
I can telnet to the port. - rune
What exactly is available on this port? Java Debugger interface or something else? - CrazyCoder
It's supposed to be java debugger interface using an ssh tunnel. When I telnet I get a connection, but no response. If I type something random, I get nothing back (I guess it only gives output if I give a valid command) - rune
What command was used on the remote to start Java debugger on this port? - CrazyCoder

1 Answers

0
votes

So it turns out that in order to enable debugging with heroku, you need a "Procfile". It is possible to run an instance without this file, but then the default parameters are used (and that's obviously what we were doing).

After adding this "Procfile", debugging finally works:

   web: java -Dserver.port=$PORT $JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=9090,suspend=n -jar target/<.jar file>