File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes unable to connect to port 5005 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "unable to connect to port 5005" Watch "unable to connect to port 5005" New topic
Author

unable to connect to port 5005

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
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

Joined: Dec 29, 2004
Posts: 1071
Looks like it's trying to use port 8080 instead of 5005
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
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

Joined: Aug 31, 2004
Posts: 225
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to connect to port 5005