stdcall
stdcall

Reputation: 28860

Remote debugging on Tomcat with Eclipse

I'm trying to initiate a remote debugging session on my PC with Eclipse & Tomcat. I managed to run tomcat (not through eclipse) with the following params:

set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=5050
cataline jpda start

The server starts ok, this is the outcome:

Using CATALINA_BASE:   "C:\Java\Tomcat"
Using CATALINA_HOME:   "C:\Java\Tomcat"
Using CATALINA_TMPDIR: "C:\Java\Tomcat\temp"
Using JRE_HOME:        "C:\Java\jdk1.6.0_27"
Using CLASSPATH:       ...
Listening for transport dt_socket at address: 5050
...
...
INFO: Server startup in 12502 ms

Now, I opened eclipse, and loaded the relevant project.

I set a new debugging configuration using Remote Java Application with localhost and the right port. however when I run it, I get this error message:

Failed to connect to remote VM. Connection refused.
Connection refused: connect

Can't really understand where is the problem. this is all local inside the PC, so there shouldn't be any firewalls involved, can someone think of something ?

Upvotes: 2

Views: 14168

Answers (4)

Balkrushna Patil
Balkrushna Patil

Reputation: 466

You can configure it in remote java application section in debug configuration. For more details you can refer this link

Upvotes: 0

Sumukh
Sumukh

Reputation: 749

There could be problems when there are code mismatches between eclipse and tomcat. So when it matches the error will disappear

Upvotes: 0

stdcall
stdcall

Reputation: 28860

Found the solution. apparently the connection was made, but Eclipse & Tomcat don'tt show any notification or status regarding it. Then, when you initiate the connection again, you get the error because you're already connected.

I think that a small notice, either from Eclipse, or from Tomcat would be nice.

Upvotes: 4

Drona
Drona

Reputation: 7234

Try adding the following debug options directly to the JVM startup by directly modifying the catalina startup script

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5050

Upvotes: 0

Related Questions