File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Trace with Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Trace with Eclipse " Watch "Trace with Eclipse " New topic
Author

Trace with Eclipse

SYong may
Greenhorn

Joined: Aug 08, 2004
Posts: 5
hi all

anybody can help me how to trace when running the project in eclipse.
I run a project of using Tomcat4.1,xml mapping,servlet,jsp and javascript.I can run that but I want to trace line by line like in VB using F8.
And I want to see the variable value in project.How can I do that?

Thanks
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
Sounds like you want to use remote debugging.

You'll need to start the project JVM with debug options like these: -Xrunjdwp:transport=dt_socket,address=7500

Then create a new remote debugging task in Eclipse (Run->Debug...->click on 'Remote Java Application'->click New) and set it up from there.

Then start your app and launch the debugging task.

That's a pretty quick summary - the doco that comes with Eclipse is pretty good on remote debugging so if you get stuck, try there.


-Tim
SYong may
Greenhorn

Joined: Aug 08, 2004
Posts: 5
Hey Tim

I do your suggestion.But how do I Start remote VM and port?Please
tell me detail step to do.

Just now I get this message.

failed to debug to remote VM Connection refused.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Or you could "simply" install and configure the Sysdeo Tomcat plugin and let it do the rest for you...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
The following work for me:

'Debug' instance - connection type 'Standard (Socket Attach)', host localhost, port 8000.

JVM startup parameter (which happens to be passed in via an Ant task):

"-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Now, start the server like normal. When you want to debug, run the debug task and it will try to connect to the JVM instance. The important thing is that you start the server like normal before you try to debug - running the debug task won't start the server for you.

I imagine that if you had some sort of firewall program it might block the port...I'd guess in this case you can set it to allow connections from localhost...

Hope that helps,


-Tim

(Edit: make the port numbers match)
[ August 10, 2004: Message edited by: Tim West ]
SYong may
Greenhorn

Joined: Aug 08, 2004
Posts: 5
Tim

I can't do again.I run the jvm as you write and start the tomcat.
And run->debug debug the project.

But the same error .

Fail to connect to remote vm.Connection refused.
Patrick Cogan
Greenhorn

Joined: Feb 11, 2004
Posts: 4
You need to set the aplication server to accept dedug requests (see above details describe this) and you need to tell eclipse where to fire the debug requests. Do this by run>debug. click on Remote java appliaction and then fill in the details.

...and Bob should then be your uncle.

see this thread as well:
http://www.coderanch.com/t/94916/Testing/Debug-ee-application
[ August 19, 2004: Message edited by: Patrick Cogan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trace with Eclipse