• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote Debugging in Eclipse

 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ashok Jag
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim, I changed the port number differently say 8585 still gettting the same error.

Thanks
Ashok
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ashok Jag
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the multiple posts.

Ashok
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic