skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

▼
 
  • RSS
  • Twitter
Thursday, September 20, 2012

Configuring Eclipse for Remote Debugging a Tomcat Java Application

Posted by Admin at 11:45 AM – 0 comments
 
Debugging Tomcat is no different than debugging any other Java remote application. You need to make sure to launch it with the required debugging arguments and attach a debugger. In the case of Tomcat, you need to add these arguments to the startup script.
We need to change catalina.bat/catalina.sh located under TOMCAT_HOME/bin.
Open catalina.bat/catalina.sh under TOMCAT_HOME/bin directory in your project domain.
Inside that just set the debug option code shown below with port number.

Once the JAVA_OPTS is set open your project in Eclipse.
From debug icon click on debug configuration and the remote java application.
Specify the debugger name and project name for which you want to set debugger.
The port number should be same as one you set incatalina.bat/catalina.sh.
Once done your are ready to debug.

set some breakpoints in your application and start Tomcat server.
Once the debugger starts you can navigate between consecutive breakpoints using F6 and F8 for juming from one BP to another



DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n  
DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n 


Leave a Reply

Newer Post Older Post
Subscribe to: Post Comments ( Atom )
  • Popular
  • Recent
  • Archives
Powered by Blogger.
 
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger