cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to connect to remote VM. Connection refused.

cristina
Champ in-the-making
Champ in-the-making
Hi,
When I try to run eclipse debugger, I am getting the error:
Failed to connect to remote VM. Connection refused


Failed to connect to remote VM. Connection refused.

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Unknown Source)

eclipse.buildId=I20090611-1540
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=it_IT
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


this are Steps for  Debugging from within Eclipse that I made

1)In the eclipse window (Run/Debug configuratio),I selected "Remote Java Application" from the list of configurations and with Right click on the "Remote Java Application" and I created a new configuration as following

On the "Connect" tab I set the connection properties with values host as "localhost" and port as "8000".

2) In the enviornment variables, add an entry jpda_address=8000;

3)In catalina.bat .  I wrote " set JPDA_TRANSPORT = dt_socket ".

4)In startup.bat I wrote comand call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%


development enviroment:
-Alfresco 3.2 is installed   on the Virtual machine with firewall disabled .The OS is WXP
-Eclipse Java EE IDE for Web Developers.   Build id: 20090621-0832

:?:  :!:  :idea:

Thanks a lot in advance
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
I think you are missing some configuration.

Here's mine.

set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

cristina
Champ in-the-making
Champ in-the-making
I read in developer guide, as to configure Tomcat.See below

——————————————————————————————————————————-
Follow these steps to set this up:
1. Set the JPDA_TRANSPORT environment variable to dt_socket.
2. Set the JPDA_ADDRESS environment variable to 8000.
3. In Tomcat's startup script, change the line that invokes Catalina to include
jpda. On Linux, this looks like:
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
4. Start Tomcat. You should see a message like "Listening for transport
dt_socket at address: 8000".
Getting Started with Alfresco
[ 54 ]
5. In Eclipse, go to the Debug Configuration dialog and create a new Remote
Java Application. Browse to the project you want to debug. Take the defaults
for everything else:
6. Click Debug.


——————————————————————————————————————————-

Now on the command "JPDA_OPTS=-agentlib:jdwp=transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%"
for "developer guide" the parameters "set JPDA_ADDRESS=8000",
while on the command on the post
          "set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n" is "JPDA_ADDRESS=4000".
the value is 4000.

which is right one?

thank you kindly

cristina
Champ in-the-making
Champ in-the-making
I must urgently know where is the problem,why are several days , that  I are  stop on the problem and I can't go beyond

Thanks a lot in advance

Cristina

darryl_staflund
Champ in-the-making
Champ in-the-making
I had this problem on Windows 7 and was able to work around it by changing the JPDA port from 8000 to 1044.

Darryl