Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to remote debug?
How to remote debug? [message #332280] Thu, 16 October 2008 16:04 Go to next message
Eclipse UserFriend
Originally posted by: vblant.shaw.ca

Hello. I've been trying to use Eclipse's remote debugging capabilities,
but I just can't get it to work. This probably means that I have a lot of
misconceptions about how it works, so I hope someone here can clear them
up for me.

Here is what I am trying to set up. I have a junit test that fails only
when it is executed by my ANT target (it works if I run it from eclipse
directly). So, I though that I will use Eclipse to remote debug the test
when it is executed by ANT. In order to do this, I performed the following
steps, which I thought would get me there:
1) Run ANT with debugging parameters, like this:
"/usr/lib/jvm/java-1.5.0-sun/jre/bin/java" -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=104 4 -classpath
" /usr/share/ant/lib/ant-launcher.jar:/usr/share/java/xmlParse rAPIs.jar:/usr/share/java/xercesImpl.jar "
-Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib"
org.apache.tools.ant.launch.Launcher -cp "" "integration-tests-agriInvest"

2) I made a "Remote Java Application" launcher in Eclipse and set it up to
connect to localhost:1044

3) On the 'Source' tab I made sure to add the project where the source
code for my junit is.

The result of this setup is that when I run Step 1, ANT correctly
tells me: "Listening for transport dt_socket at address: 1044" and waits
until I go to Eclipse and launch my remote configuration. As the test
runs, I can see the remote threads in Eclipse, so everything looks good.

However, I can't get Eclipse to stop on my breakpoint! What am I missing?

Please help. Thanks.


Val
Re: How to remote debug? [message #332289 is a reply to message #332280] Fri, 17 October 2008 08:38 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Since I did this myself this week: did you compile your application
with debug info included? It's easy to forget if you use an external
build meant for a release version.

Achim
--
Achim Lörke

Eclipse-Stammtisch in the Braunschweig, Germany area:
http://www.bredex.de/de/news/events.html


Achim Lörke

Re: How to remote debug? [message #332293 is a reply to message #332280] Fri, 17 October 2008 13:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Val Blant wrote:
> Hello. I've been trying to use Eclipse's remote debugging capabilities,
> but I just can't get it to work. This probably means that I have a lot of
> misconceptions about how it works, so I hope someone here can clear them
> up for me.
>
> Here is what I am trying to set up. I have a junit test that fails only
> when it is executed by my ANT target (it works if I run it from eclipse
> directly). So, I though that I will use Eclipse to remote debug the test
> when it is executed by ANT. In order to do this, I performed the following
> steps, which I thought would get me there:
> 1) Run ANT with debugging parameters, like this:
> "/usr/lib/jvm/java-1.5.0-sun/jre/bin/java" -Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=104 4 -classpath
> " /usr/share/ant/lib/ant-launcher.jar:/usr/share/java/xmlParse rAPIs.jar:/usr/share/java/xercesImpl.jar "
> -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib"
> org.apache.tools.ant.launch.Launcher -cp "" "integration-tests-agriInvest"
>
> 2) I made a "Remote Java Application" launcher in Eclipse and set it up to
> connect to localhost:1044
>
> 3) On the 'Source' tab I made sure to add the project where the source
> code for my junit is.
>
> The result of this setup is that when I run Step 1, ANT correctly
> tells me: "Listening for transport dt_socket at address: 1044" and waits
> until I go to Eclipse and launch my remote configuration. As the test
> runs, I can see the remote threads in Eclipse, so everything looks good.
>
> However, I can't get Eclipse to stop on my breakpoint! What am I missing?

Sounds like you did pretty much everything correctly. The only thing I
can think of to ask is, did you select the appropriate Project when
creating the debug launch config, not on the Source tab but on the
Connect tab? If you do that, you should not usually have to set any
additional stuff on the Source tab.

Hope this helps,
Eric
Re: How to remote debug? [message #332307 is a reply to message #332289] Fri, 17 October 2008 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vblant.shaw.ca

On Fri, 17 Oct 2008 10:38:48 +0200, Achim Lörke wrote:

> Since I did this myself this week: did you compile your application
> with debug info included? It's easy to forget if you use an external
> build meant for a release version.
>
> Achim

Yeah, I thought of that too and put debug="true" and
debuglevel="lines,vars,source" on all of my javac ant targets.

After that I did 'ant clean' to delete the old .class files and cause a
recompile, but I still can't get it to stop on my breakpoint...

Is this what you had to do in your ANT scripts, or was there something else?


Val
Re: How to remote debug? [message #332308 is a reply to message #332293] Fri, 17 October 2008 16:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vblant.shaw.ca

On Fri, 17 Oct 2008 09:12:47 -0400, Eric Rizzo wrote:
> Sounds like you did pretty much everything correctly. The only thing I
> can think of to ask is, did you select the appropriate Project when
> creating the debug launch config, not on the Source tab but on the
> Connect tab? If you do that, you should not usually have to set any
> additional stuff on the Source tab.
>
> Hope this helps,
> Eric


My application actually consists of many different Eclipse projects. On
the Connect tab I selected the project that contains the junit test I
wanted to debug. Is this correct?



Val
Re: How to remote debug? [message #332423 is a reply to message #332308] Tue, 21 October 2008 13:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/17/2008 12:45 PM, Val Blant wrote:
> On Fri, 17 Oct 2008 09:12:47 -0400, Eric Rizzo wrote:
>> Sounds like you did pretty much everything correctly. The only thing I
>> can think of to ask is, did you select the appropriate Project when
>> creating the debug launch config, not on the Source tab but on the
>> Connect tab? If you do that, you should not usually have to set any
>> additional stuff on the Source tab.
>>
>> Hope this helps,
>> Eric
>
>
> My application actually consists of many different Eclipse projects. On
> the Connect tab I selected the project that contains the junit test I
> wanted to debug. Is this correct?

Generally, yes. I'm trying to think of what kind of setup would cause it
to not hit breakpoints, and I'm coming up mostly blank.
Does the JUnit project depend on the other projects directly, or on JARs
that are produced from those projects?

Maybe if you describe your project setup in more detail, we might spot
something that is out of the ordinary...

Eric
Re: How to remote debug? [message #332435 is a reply to message #332423] Tue, 21 October 2008 17:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vblant.shaw.ca

On Tue, 21 Oct 2008 09:19:55 -0400, Eric Rizzo wrote:
> Maybe if you describe your project setup in more detail, we might spot
> something that is out of the ordinary...

Here is how my projects are setup:
OPS - Container project for all kinds of library jars that all other
projects include in their build path

OPSCommon

OPSShared (depends on OPSCommon)

OPSBusiness (depends on OPSCommon, OPSShared) - this is where the
JUnit test is

OPSWeb (depends on OPSCommon, OPSShared, OPSBusiness)
Re: How to remote debug? [message #332451 is a reply to message #332435] Tue, 21 October 2008 19:41 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/21/2008 1:35 PM, Val Blant wrote:
> On Tue, 21 Oct 2008 09:19:55 -0400, Eric Rizzo wrote:
>> Maybe if you describe your project setup in more detail, we might spot
>> something that is out of the ordinary...
>
> Here is how my projects are setup:
> OPS - Container project for all kinds of library jars that all other
> projects include in their build path
>
> OPSCommon
>
> OPSShared (depends on OPSCommon)
>
> OPSBusiness (depends on OPSCommon, OPSShared) - this is where the
> JUnit test is
>
> OPSWeb (depends on OPSCommon, OPSShared, OPSBusiness)

In what project(s) have you set the breakpoint(s) that are not hit when
you debug the JUnit test?

One other idea I had: try deleting the launch configuration for your
test, then right-click on the test class (or package or project that
contains it) and choose Debug As > JUnit Test. That will force it to
re-generate a new launch configuration that should (hopefully) be correct.

Eric
Previous Topic:[swt][cocoa] Cannot run an Eclipse application with the SWT Cocoa port
Next Topic:refresh file with refreshLocal( ), does not sync all tabs in Multipage ed
Goto Forum:
  


Current Time: Thu Apr 25 17:15:55 GMT 2024

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

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

Back to the top