This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to connect to port 5005

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to use remote debugging in my IDE (Intelli-J IDEA).
However I am not able to connect for some reason and am receiving the following exception. Any ideas?:

Failed to establish connection to the target VM at 'localhost:8080' using socket transport.
Process not started.
Unable to launch target VM : java.net.ConnectException "Connection refused: connect"
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like it's trying to use port 8080 instead of 5005
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I misstated the previous post. The exception I am receiving is:

Failed to establish connection to the target VM at 'localhost:5005' using socket transport.
Process not started.
Unable to launch target VM : java.net.ConnectException "Connection refused: connect"
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out. I had to start Tomcat in debugger mode. To do this I had to add a few parameters to catalina.bat:


set _EXECJAVA=%_RUNJAVA%
set MAINCLASS=org.apache.catalina.startup.Bootstrap
set ACTION=start
set SECURITY_POLICY_FILE=
set DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
set JPDA=


Also, if you run Tomcat using the jar, it will not pick up these changes. You would have to start Tomcat using startup.bat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic