Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.
The following page has been changed by markt: http://wiki.apache.org/tomcat/FAQ/Developing The comment on the change is: Add question list to start. ------------------------------------------------------------------------------ This section of the FAQ discusses common questions related to Tomcat development. == Questions == + 1. [#Q1 How do I configure Tomcat to support remote debugging?] + 1. [#Q2 How do I remotely debug Tomcat using Eclipse?] + 1. [#Q3 How do I remotely debug Tomcat using NetBeans?] + 1. [#Q4 How do I change the monitoring interval for modified resources and application reloading?] + == Answers == - '''How do I configure Tomcat to support remote debugging?''' + [[Anchor(Q1)]]'''How do I configure Tomcat to support remote debugging?''' The short answer is to add the following options when the JVM is started: {{{-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n}}} @@ -18, +23 @@ Whilst this is very useful in development it should not be used in production because of both security and performance implications. - '''How do I remotely debug Tomcat using Eclipse?''' + [[Anchor(Q2)]]'''How do I remotely debug Tomcat using Eclipse?''' This answer assumes that you have a project set up with all of the fixings and have some idea of what you're doing in this respect. If not then thats really outside the scope of this topic and more in the scope of you needing to go to [[http://eclipse.org eclipse.org]] and read up on how to use your ide, and maybe practice a little bit before you come back to this. We're also going to assume you have some idea of what a debugger is and how to use one. Make sure tomcat is started and that your app is deployed and the sources, etc are all defined as resources in your app. If you have a servlet or something, set a breakpoint where its sure to hit on the next request. Go to "Run->Debug...". Click on "Remote Java Applications", then click "New". Type in the title and all. Notice that port 8000 from the Tomcat instructions. Save and run. Eclipse will connect to the VM that Tomcat is running under. Wow, that was easy! Now go type the url to submit to your servlet or whatever in your browser. Boom you hit the breakpoint right? Have fun! - '''How do I remotely debug Tomcat using NetBeans IDE?''' + [[Anchor(Q3)]]'''How do I remotely debug Tomcat using NetBeans?''' - This answer assumes that you have correctly set up a NetBeans IDE project and that you know how to use the NetBeans IDE debugger. If not, please go to http://www.netbeans.org/kb/using-netbeans/40/debug.html and read up on how to use NetBeans IDE and its debugger. + This answer assumes that you have correctly set up a NetBeans project and that you know how to use the NetBeans debugger. If not, please go to http://www.netbeans.org/kb/using-netbeans/40/debug.html and read up on how to use NetBeans and its debugger. Make sure that Tomcat is started in debug mode as described above, that your application is deployed, and that the sources are all defined as resources in your application. If you have a servlet or JSP file, set a breakpoint where you think a problem might be occurring. Go to "Run->Attach Debugger". A dialog pops up to let you specify the following options: @@ -38, +43 @@ When you press OK, you have a debugging connection very similar to local debugging. - Note that NetBeans IDE has a second option -- you can debug JSP files and servlets locally using a Tomcat server that is bundled with the IDE. When you debug a JSP file or servlet in the IDE, the bundled Tomcat server automatically starts in debug mode, and the debugger connects to it. + Note that NetBeans has a second option -- you can debug JSP files and servlets locally using a Tomcat server that is bundled with the IDE. When you debug a JSP file or servlet in the IDE, the bundled Tomcat server automatically starts in debug mode, and the debugger connects to it. - '''How do I change the monitoring interval for modified resources and application reloading?''' + [[Anchor(Q4)]]'''How do I change the monitoring interval for modified resources and application reloading?''' Modify the {{{checkInterval}}} attribute value on the relevant Loader element in your web application configuration file (yourapp.xml), or in the main configuration file {{{%CATALINA_HOME%/conf/server.xml}}} if that is the one you're using. For more information, please see the [[http://tomcat.apache.org/faq/config/loader.html Loader configuration reference]]. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]