wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Remote Debugging in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Remote Debugging in Eclipse" Watch "Remote Debugging in Eclipse" New topic
Author

Remote Debugging in Eclipse

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
Hi,

I am using apache tomcat 6.0.13 to deploy the web application remotedly in Eclipse 3.3

I always get the same error message
Failed to connect to remote VM. Connection refused.
Connection refused: connect

host is localhost, and port is 8000.

I have seen other posts in this forum for hte same topic, but no solution. Here is hoping that I get a solution.

Thanks,

Kartik
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

The remote debug port is NOT the same port as the web request port. When you start Tomcat on the remote machine, the startup script has to specify a debug port or you won't get remote debugging.

The debug port belongs to the JVM - any Java app can be remotely debugged, not just server apps.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ashok Jag
Greenhorn

Joined: Sep 21, 2005
Posts: 18
Tim, I changed the port number differently say 8585 still gettting the same error.

Thanks
Ashok
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Ashok Jag:
Tim, I changed the port number differently say 8585 still gettting the same error.

Thanks
Ashok


*Which* port number did you change?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ashok Jag
Greenhorn

Joined: Sep 21, 2005
Posts: 18
The port number specified in "Remote Java Application" in Eclipse for Tomcat 5.0.28 , I changed the port to 8585 instead of the standard 8000.
I have the Host as : localhost

Thanks
Ashok
Ashok Jag
Greenhorn

Joined: Sep 21, 2005
Posts: 18
Sorry the Tomcat version is 5.5.4

Here is what I am doing, I have added on catalina.bat for Tomcat 5.5.4
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=8000

on eclipse - Run --> Open Debug Dialog
Remote Java Application --> New , entered

host as "localhost"
port as "8000"

Started Tomcat on Cmd prmpt
In the output, I can see this msg
"Listening for transport dt_socket at address: 8000"

Click on debug on Eclipse . I see

Java HotSpot(TM) Client VM[localhost:8000]
Daemon Thread [TP-Monitor] (Running)
Daemon Thread [TP-Processor4] (Running)
Daemon Thread [TP-Processor3] (Running)
Daemon Thread [TP-Processor2] (Running)
Daemon Thread [TP-Processor1] (Running)
Thread [http-8080-Monitor] (Running)
Daemon Thread [http-8080-Processor25] (Running)
Daemon Thread [http-8080-Processor24] (Running)
Daemon Thread [http-8080-Processor23] (Running)
Daemon Thread [http-8080-Processor22] (Running)
Daemon Thread [http-8080-Processor21] (Running)
Daemon Thread [http-8080-Processor20] (Running)
Daemon Thread [http-8080-Processor19] (Running)
Daemon Thread [http-8080-Processor18] (Running)
Daemon Thread [http-8080-Processor17] (Running)
Daemon Thread [http-8080-Processor16] (Running)
Daemon Thread [http-8080-Processor15] (Running)
Daemon Thread [http-8080-Processor14] (Running)
Daemon Thread [http-8080-Processor13] (Running)
Daemon Thread [http-8080-Processor12] (Running)
Daemon Thread [http-8080-Processor11] (Running)
Daemon Thread [http-8080-Processor10] (Running)
Daemon Thread [http-8080-Processor9] (Running)
Daemon Thread [http-8080-Processor8] (Running)
Daemon Thread [http-8080-Processor7] (Running)
Daemon Thread [http-8080-Processor6] (Running)
Daemon Thread [http-8080-Processor5] (Running)
Daemon Thread [http-8080-Processor4] (Running)
Daemon Thread [http-8080-Processor3] (Running)
Daemon Thread [http-8080-Processor2] (Running)
Daemon Thread [http-8080-Processor1] (Running)
Daemon Thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Running)
Daemon Thread [Store userCache Expiry Thread] (Running)
Daemon Thread [Store userCache Spool Thread] (Running)
Thread [main] (Running)


When I try to open my project in the brwoser I dont see my page :-( and in run mode I cud see

In debug mode I try to use this url

http://localhost:8000/fsdc/login.jsp

In Run Mode I am using 8080 port

http://localhost:8080/fsdc/login.jsp

Is it right? Please help wat shud be the problem and if I see the page will the breakpoint will work?

Please help!

Thanks
Ashok
Ashok Jag
Greenhorn

Joined: Sep 21, 2005
Posts: 18
Sorry for the multiple posts.

Ashok
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

It's not Eclipse that's the problem. Unless you start Tomcat with remote debuggin enabled, no debugging port will be opened. If you're starting from a shell script/batch file, you will probably have to actually change the startup script (some versions of this script have a comment line that tells you how to do this).

On a local machine using a J2EE development system such as the sysdeo Tomcat plugin, the plugin starts Tomcat as an embedded server and switches on remote debugging automatically, but if you're launching Tomcat yourself, you also have to switch on the debugging port yourself.

You have to tell Eclipse what port to talk to as a client - which you did. But Tomcat has to also be told to switch that port on as a debugging server.

Like I said earlier, the debugging server isn't directly related to Tomcat's being a web server - any Java application can run a debug server. It's a completely independent function.
Ashok Jag
Greenhorn

Joined: Sep 21, 2005
Posts: 18
Thanks Tim for your input.

I figured out the problem, I had 2 versions of Sysdeo plugin under eclipse plugin directories, that was creating problem as a result debugger was not happening when I ran it on debug mode.

As you said in this case, Tomcat was not to able to switch to this port for debugging.

Thanks
Ashok
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote Debugging in Eclipse
 
Similar Threads
Remote Debugging with Eclipse
How to debug weblogic applications using eclipse
regarding Remote debuge
RMI Exception
Eclipse atg debug port