Eclipse remote debugging [message #269374] |
Mon, 30 August 2004 19:52  |
Eclipse User |
|
|
|
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 #269781 is a reply to message #269549] |
Thu, 02 September 2004 07:21   |
Eclipse User |
|
|
|
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 #269907 is a reply to message #269905] |
Thu, 02 September 2004 18:44  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05033 seconds