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 debug j2ee application from Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "debug j2ee application from Eclipse" Watch "debug j2ee application from Eclipse" New topic
Author

debug j2ee application from Eclipse

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
If I don't start applicatin server from Eclipse, i.e. I start the app server from command line. Then can I still use Eclipse to debug the j2ee application ? I thought I can only debug the application if I use install an application server plugin and start from Eclipse. Is my understanding correct ?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31054
    
162

Raj,
Not necessarily. You can use the Eclipse remote debugger if your configuration supports it.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

The Sun JVM has built-in remote debugging support. Most app servers, including Tomcat, have an option in their startup scripts to switch on that debugger. In fact, the sysdeo Tomcat plugin does pretty much just that - it starts a copy of Tomcat, then does an automatic remote debugging connection to it.

The only constraint is that to debug properly, the application's source code available to Eclipse must match the compiled classes on the server. If it isn't, the breakpoints won't match up properly and you'll probably get very confused.


Customer surveys are for companies who didn't pay proper attention to begin with.
Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
I guess I did not explain it very well in my post. It is not for a remote debugging. I installed an application server and Eclipse on my PC, also I installed an application server plugin for eclipse. However, the plugin has some problem so I can't start the application server from eclipse. But I can start the server from command line.

My j2ee application code is in eclipse, so in this case, after I deploy the code, can I use command line to start the application server and use eclipse to debug ?
Sunil Vasudevan
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
Originally posted by Raj Ohadi:

My j2ee application code is in eclipse, so in this case, after I deploy the code, can I use command line to start the application server and use eclipse to debug ?


If you are starting the app server from command line, you would need to use remote debugging. Remote debugging can be done using Eclipse IDE. But it needs few configuration to be done on App Server start-up scripts and Eclipse runtime configurations.

Check the help documentation of Eclipse to get information on Remote debugging.


Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Originally posted by Raj Ohadi:
If I don't start applicatin server from Eclipse, i.e. I start the app server from command line. Then can I still use Eclipse to debug the j2ee application ? I thought I can only debug the application if I use install an application server plugin and start from Eclipse. Is my understanding correct ?


In short yes you can.
You can go to application server console and set to start server in debug mode. In eclipse you have to set to listen to the debug port which is server specific.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: debug j2ee application from Eclipse