Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Eclipse remote debugging
Eclipse remote debugging [message #269374] Mon, 30 August 2004 19:52 Go to next message
Eclipse UserFriend
Originally posted by: chris.accent.co.uk

Further to my earlier posting "Eclipse 3.0 / Tomcat remote debugging" I
seem unable to get Eclipse 3.0 to perform remote debugging with anything.
Whether it be Tomcat or a simple Java application (started with the
correct parameters) Eclipse simply refuses to connect - or rather it's
connection seems to be refused.

I have proved that the problem seems to lie with Eclipse as if I use the
Sun provided jdb application I can connect to my remote applications
(Tomcat or whatever). The following command was used to test this

jdb -connect com.sun.jdi.SocketAttach:hostname=MYSERVER,port=8000

Upon further inspection of my Eclipse installation I found that all the
Java settings were pointing to the JRE rather than JDK so I tried running
Eclipse with the -vm option to force it to use my JDK but it could still
not connect with the following errors resulting for each JVM setting . . .

running with default settings which seems to pick-up the jre rather than
jdk

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.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.SocketTransportImpl.attach( SocketTransportImpl.java:47)
at
org.eclipse.jdi.internal.connect.SocketAttachingConnectorImp l.attach(SocketAttachingConnectorImpl.java:103)
at
org.eclipse.jdt.internal.launching.SocketAttachConnector.con nect(SocketAttachConnector.java:131)
at
org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaun chConfigurationDelegate.launch(JavaRemoteApplicationLaunchCo nfigurationDelegate.java:75)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:569)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:788)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:955)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)


running with eclipse -vm c:\j2sdk1.4.2_05\bin\java.exe

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.ja va:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at
org.eclipse.jdi.internal.connect.SocketTransportImpl.attach( SocketTransportImpl.java:47)
at
org.eclipse.jdi.internal.connect.SocketAttachingConnectorImp l.attach(SocketAttachingConnectorImpl.java:103)
at
org.eclipse.jdt.internal.launching.SocketAttachConnector.con nect(SocketAttachConnector.java:131)
at
org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaun chConfigurationDelegate.launch(JavaRemoteApplicationLaunchCo nfigurationDelegate.java:75)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:569)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:788)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:955)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

Any ideas?
Re: Eclipse remote debugging [message #269549 is a reply to message #269374] Tue, 31 August 2004 11:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Chris wrote:

> Further to my earlier posting "Eclipse 3.0 / Tomcat remote debugging" I
> seem unable to get Eclipse 3.0 to perform remote debugging with anything.
> Whether it be Tomcat or a simple Java application (started with the
> correct parameters) Eclipse simply refuses to connect - or rather it's
> connection seems to be refused.
>
> I have proved that the problem seems to lie with Eclipse as if I use the
> Sun provided jdb application I can connect to my remote applications
> (Tomcat or whatever). The following command was used to test this
>
> jdb -connect com.sun.jdi.SocketAttach:hostname=MYSERVER,port=8000

What are the specifics of the Debug Launch configuration that you are
using to try to connect? (Connection Type, Connection Properties, etc.)

What are the JVM params you are using to start the remote application?

I do this on a regular basis, so I know it works. And there is not very
much that has to be done on the Eclipse side to make it work (just the 2
or 3 settings above).

Eric
Re: Eclipse remote debugging [message #269656 is a reply to message #269374] Wed, 01 September 2004 09:21 Go to previous messageGo to next message
Eclipse UserFriend
>
> java.net.ConnectException: Connection refused: connect

Do you have a firewall causing trouble?

Darin
Re: Eclipse remote debugging [message #269781 is a reply to message #269549] Thu, 02 September 2004 07:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.accent.co.uk

Eric,

Here is an example of how the remote applications are being started - this
the start command that TOMCAT is using:

start "Tomcat" "c:\j2sdk1.4.2\bin\java" -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend= n
-Djava.endorsed.dirs="C:\Program Files\Apache Software Foundation\Tomcat
5.0\common\end
orsed" -classpath "c:\j2sdk1.4.2\lib\tools.jar;C:\Program Files\Apache
Software Foundation\Tomcat 5.0\bin\bootstrap.jar"
-Dcatalina.base="C:\Program Files\Apache Software Foundation\Tomcat 5.0"
-Dcata
lina.home="C:\Program Files\Apache Software Foundation\Tomcat 5.0"
-Djava.io.tmpdir="C:\Program Files\Apache Software Foundation\Tomcat
5.0\temp" org.apache.catalina.startup.Bootstrap start

And within Eclipse I try to debug a class with the following settings:

Connection type: Standard (Socket Attach)
Host: IP Address of server
Post: 8000

What I find odd is that the Java jdp command does work and connect to the
remote application. Also I see Eclipse is by default running using the
JRE rather than JDK - and changing it using the -VM parameter did not help
although it did produce a different error message as in my earlier posting.

Also, as I said, this used to work with Eclipse 2.1 but not 3

Regards,

Chris.

Eric Rizzo wrote:

> Chris wrote:

> > Further to my earlier posting "Eclipse 3.0 / Tomcat remote debugging" I
> > seem unable to get Eclipse 3.0 to perform remote debugging with anything.
> > Whether it be Tomcat or a simple Java application (started with the
> > correct parameters) Eclipse simply refuses to connect - or rather it's
> > connection seems to be refused.
> >
> > I have proved that the problem seems to lie with Eclipse as if I use the
> > Sun provided jdb application I can connect to my remote applications
> > (Tomcat or whatever). The following command was used to test this
> >
> > jdb -connect com.sun.jdi.SocketAttach:hostname=MYSERVER,port=8000

> What are the specifics of the Debug Launch configuration that you are
> using to try to connect? (Connection Type, Connection Properties, etc.)

> What are the JVM params you are using to start the remote application?

> I do this on a regular basis, so I know it works. And there is not very
> much that has to be done on the Eclipse side to make it work (just the 2
> or 3 settings above).

> Eric
Re: Eclipse remote debugging [message #269868 is a reply to message #269781] Thu, 02 September 2004 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Chris wrote:

> Eric,
>
> Here is an example of how the remote applications are being started - this
> the start command that TOMCAT is using:
>
> start "Tomcat" "c:\j2sdk1.4.2\bin\java" -Xdebug
> -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend= n
[snip]

>
> And within Eclipse I try to debug a class with the following settings:
>
> Connection type: Standard (Socket Attach)
> Host: IP Address of server
> Post: 8000
>
> What I find odd is that the Java jdp command does work and connect to the
> remote application. Also I see Eclipse is by default running using the
> JRE rather than JDK - and changing it using the -VM parameter did not help
> although it did produce a different error message as in my earlier posting.
>
> Also, as I said, this used to work with Eclipse 2.1 but not 3

Weird. Your VM parameters look fine, except for missing the
-Djava.compiler=NONE option which I don't think is absolutely required
(though recommended).

Are you using windoze XP on either machine or some other firewall that
might be blocking connections? Do you have any network sniffing tools to
see if the connection attempt is getting to the server machine? Can you
connect to port 8000 on the server machine with a simple telnet client?

HTH,
Eric
Re: Eclipse remote debugging [message #269891 is a reply to message #269868] Thu, 02 September 2004 16:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.accent.co.uk

Eric Rizzo wrote:

> Weird. Your VM parameters look fine, except for missing the
> -Djava.compiler=NONE option which I don't think is absolutely required
> (though recommended).

> Are you using windoze XP on either machine or some other firewall that
> might be blocking connections? Do you have any network sniffing tools to
> see if the connection attempt is getting to the server machine? Can you
> connect to port 8000 on the server machine with a simple telnet client?

> HTH,
> Eric

Hi Eric,

Yes I am using Windows XP but this used to work on my older machine with
XP and the fact that the Java 'jdb' application works, connects and exits
when the remote app is shut means it must be working.

What version of Eclipse and Java are you running?

Regards,

Chris.
Re: Eclipse remote debugging [message #269893 is a reply to message #269891] Thu, 02 September 2004 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Chris wrote:
> Yes I am using Windows XP but this used to work on my older machine with
> XP and the fact that the Java 'jdb' application works, connects and exits
> when the remote app is shut means it must be working.

My main thought was that the new XP SP2 might have been applied recently
and it is known to break functionality on a large number of
applications. One of the major things SP2 supposedly includes is
enabling its built-in firewall by default (it used to be off by default,
IIUC).

> What version of Eclipse and Java are you running?

Currently, Eclipse 3.0 and JVM 1.3; but I've done this with a variety of
Eclipse versions and an even greater variety of JVM versions.
My next shot in the dark would be the network sniffing or trying to
telnet to the debug listening port, as I suggested earlier. Good luck...

HTH,
Eric
Re: Eclipse remote debugging [message #269905 is a reply to message #269893] Thu, 02 September 2004 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.accent.co.uk

Hi Eric,

Problem solved - it's Eclipse 3.0 - upon the first connection to a remote
application Eclipse appeared to do nothingthing although it did actually
connect but did not switch to the degug perspective! As it didn't I
simply selected to debug the class gain and the the connection refused
happened. It's not just remote debugging though, I have tried to debug a
local app and the same thing happens - Eclipse does not switch to the
debug perspective even though that is set.

I tried a fresh install of 2.1.3 and that works a treat so I guess that is
a bug within Eclipse 3.0.

Many thanks for your help.

Regards,

Chris.

Eric Rizzo wrote:

> Chris wrote:
> > Yes I am using Windows XP but this used to work on my older machine with
> > XP and the fact that the Java 'jdb' application works, connects and exits
> > when the remote app is shut means it must be working.

> My main thought was that the new XP SP2 might have been applied recently
> and it is known to break functionality on a large number of
> applications. One of the major things SP2 supposedly includes is
> enabling its built-in firewall by default (it used to be off by default,
> IIUC).

> > What version of Eclipse and Java are you running?

> Currently, Eclipse 3.0 and JVM 1.3; but I've done this with a variety of
> Eclipse versions and an even greater variety of JVM versions.
> My next shot in the dark would be the network sniffing or trying to
> telnet to the debug listening port, as I suggested earlier. Good luck...

> HTH,
> Eric
Re: Eclipse remote debugging [message #269907 is a reply to message #269905] Thu, 02 September 2004 18:44 Go to previous message
Eclipse UserFriend
So you have:

1. Window>Preferences>Run/Debug>Launching>Switch to associated
perspective when launching set to Prompt or Always

2. The assocaited Perspective for your Remote Java app and Java app
configs is set to the debug perspective (check by selecting the Launch
configuration type in the launch configuration dialog)

If that is the case (I can't reproduce) please log a bug report with all the
details against Platform Debug

Thanks
Darins

"Chris" <chris@accent.co.uk> wrote in message
news:ch86q4$c8k$1@eclipse.org...
> Hi Eric,
>
> Problem solved - it's Eclipse 3.0 - upon the first connection to a remote
> application Eclipse appeared to do nothingthing although it did actually
> connect but did not switch to the degug perspective! As it didn't I
> simply selected to debug the class gain and the the connection refused
> happened. It's not just remote debugging though, I have tried to debug a
> local app and the same thing happens - Eclipse does not switch to the
> debug perspective even though that is set.
>
> I tried a fresh install of 2.1.3 and that works a treat so I guess that is
> a bug within Eclipse 3.0.
>
> Many thanks for your help.
>
> Regards,
>
> Chris.
>
> Eric Rizzo wrote:
>
> > Chris wrote:
> > > Yes I am using Windows XP but this used to work on my older machine
with
> > > XP and the fact that the Java 'jdb' application works, connects and
exits
> > > when the remote app is shut means it must be working.
>
> > My main thought was that the new XP SP2 might have been applied recently
> > and it is known to break functionality on a large number of
> > applications. One of the major things SP2 supposedly includes is
> > enabling its built-in firewall by default (it used to be off by default,
> > IIUC).
>
> > > What version of Eclipse and Java are you running?
>
> > Currently, Eclipse 3.0 and JVM 1.3; but I've done this with a variety of
> > Eclipse versions and an even greater variety of JVM versions.
> > My next shot in the dark would be the network sniffing or trying to
> > telnet to the debug listening port, as I suggested earlier. Good luck...
>
> > HTH,
> > Eric
>
>
Previous Topic:Dropdown menu for toolbar button
Next Topic:Launching multiple programs
Goto Forum:
  


Current Time: Wed Aug 20 02:03:16 EDT 2025

Powered by FUDForum. Page generated in 0.05033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top