This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

debug j2ee application from Eclipse

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj,
Not necessarily. You can use the Eclipse remote debugger if your configuration supports it.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18009
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic