You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Konstantin Kolinko (Confluence)" <no...@apache.org> on 2019/11/24 02:40:08 UTC

[CONF] Apache Tomcat > Developing

There's **1 new edit** on this page  
---  
|  
---  
|  | [![page icon](cid:page-
icon)](https://cwiki.apache.org/confluence/display/TOMCAT/Developing?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view
"page icon")  
---  
[Developing](https://cwiki.apache.org/confluence/display/TOMCAT/Developing?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view
"Developing")  
|  |  |  |  | ![](cid:avatar_892fc5b633a433d86a56f192323474ea) |  | Konstantin
Kolinko edited this page  
---  
|  
|  | Here's the version comment  
---  
|  
---  
|  |  | ![](cid:avatar_892fc5b633a433d86a56f192323474ea) |  | Konstantin
Kolinko edited at [02:36
AM](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103098864)  
---  
|  |  |  Add a permalink. Fix formatting. Convert links to https.  
---  
|  
|  | Here's what changed:  
---  
|

_Permalink_ to this page: [
https://cwiki.apache.org/confluence/x/8CklBg](https://cwiki.apache.org/confluence/x/8CklBg)

## About

This section of the FAQ discusses common questions related to Tomcat
development.

...

A full explanation for Tomcat in Eclipse can be found here:

  * Tomcat 89.0.x: http[https://tomcat.apache.org/tomcat-](https://tomcat.apache.org/tomcat-9.0-doc/building.html#Building_with_Eclipse)8[9.0-doc/building.html#Building_with_Eclipse](https://tomcat.apache.org/tomcat-9.0-doc/building.html#Building_with_Eclipse)
  * Tomcat 78.05.x: http[https://tomcat.apache.org/tomcat-](https://tomcat.apache.org/tomcat-8.5-doc/building.html#Building_with_Eclipse)7[8.](https://tomcat.apache.org/tomcat-8.5-doc/building.html#Building_with_Eclipse)0[5-doc/building.html#Building_with_Eclipse](https://tomcat.apache.org/tomcat-8.5-doc/building.html#Building_with_Eclipse)
  * Tomcat 67.0.x: http[https://tomcat.apache.org/tomcat-](https://tomcat.apache.org/tomcat-7.0-doc/building.html#Building_with_Eclipse)6[7.0-doc/building.html#Building_with_Eclipse](https://tomcat.apache.org/tomcat-7.0-doc/building.html#Building_with_Eclipse)

### Debugging

|
![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/anchor.png)
Anchor  
---  
|  | Q1  
---|---  
| Q1  
  
#### How do I configure Tomcat to support remote debugging?

The short answer is to add the following options when the JVM is started:

![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/noformat.png)
No Format  
---  
      
    
    
    -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
      
  
...

  * If you are using **shell scripts** to start Tomcat, start it with the following command:

![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/noformat.png)
No Format  
---  
      
         
     catalina jpda start  
      
  
It will start Tomcat so that a remote debugger can be connected to port 8000.  
The above mentioned options can be provided by setting certain environment
variables. See the comments at the top of `catalina.sh` or `.bat` file for
details.  
For example, the port number and JPDA transport implementation can be set with
`JPDA_ADDRESS=8000` and `JPDA_TRANSPORT=dt_socket`.

  * If you run Tomcat using **service wrapper** , add the above JVM options before any other JVM options. Check the documentation for the service wrapper to determine how to set JVM options.
  * If you start Tomcat from within an IDE, check the documentation for the IDE to determine how to set the required JVM options.

...

This answer assumes that you have a project set up and have some idea of what
you are doing in this respect. If not then that is really outside the scope of
this topic and you need to go to [eclipse.org](https://eclipse.org/) and read
up on how to use your IDE, and maybe practice a little bit before you come
back to this. We are also going to assume that you have some idea of what a
debugger is and how to use one.

...

#### How do I remotely debug Tomcat using NetBeans?

This answer assumes that you know how to work with a NetBeans Project, and
also 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.

...

Monitoring interval for application reloading is controlled by the
`backgroundProcessorDelay` property on `Context` element or on its parent
containers: `Host` and `Engine`. See [Tomcat Configuration
Reference](https://tomcat.apache.org/tomcat-9.0-doc/config/index.html) for
details. By default there is a single background processing thread that is run
by Engine. See its
[configuration](https://tomcat.apache.org/tomcat-9.0-doc/config/engine.html)
for the default delay value.

Interval that controls reloading of the changed JSP pages is set in the
[Jasper configuration](https://tomcat.apache.org/tomcat-9.0-doc/jasper-
howto.html) in `web.xml`.

![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/anchor.png)
Anchor  
---  
|  | Q6  
---|---  
| Q6  
  
#### Official Eclipse IDE Web Tools FAQ for Tomcat

Eclipse IDE has support for development of Web applications and running them
on Apache Tomcat. This support is provided by [Eclipse Web Tools Platform
Project](https://projects.eclipse.org/projects/webtools). An easy way to get
Web Tools is to download "for Java EE Developers" edition of [Eclipse
IDE](https://www.eclipse.org/downloads/).

The Web Tools project has a FAQ page.

  * [WTP Tomcat FAQ](https://wiki.eclipse.org/WTP_Tomcat_FAQ)
  * In [Eclipse Help](https://help.eclipse.org/) see "Web Tools Platform User Guide" > "Using the server tools" > "Testing and publishing on your server"

...  
  
|  |  | [Go to page
history](https://cwiki.apache.org/confluence/pages/viewpreviousversions.action?pageId=103098864&src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db "Go to page
history")  
---  
---  
| [View
page](https://cwiki.apache.org/confluence/display/TOMCAT/Developing?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view)  
---  
  
|  | [Stop watching
space](https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=TOMCAT&src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=stop-
watching&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ4c3JmOjhhYTk4MDk1NjlkNDIzY2QwMTZhMDQxMzMwNmYwMGRiIiwicXNoIjoiYmIwMDBlY2IyNjk4OGQ5NWE4YTFmYmIxNWNmOTQ4YWQ5NmI1NWYxMTNlZjA0M2QzMjJkOTMxYzVjZjMxZjVhYSIsImlzcyI6ImNvbmZsdWVuY2Vfbm90aWZpY2F0aW9uc0FSRUgtWFVEMS1QT1FHLUNTQU8iLCJleHAiOjE1NzUxNjgwMDgsImlhdCI6MTU3NDU2MzIwOH0.QGSdGsscPPTitB11wJNjrUKprJvlfayDgWmqVYMfxcQ)
| •  
---|---  
[Manage
notifications](https://cwiki.apache.org/confluence/users/editmyemailsettings.action?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574563208450&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=manage)  
---  
| ![Confluence logo big](cid:footer-desktop-logo)  
---  
This message was sent by Atlassian Confluence 6.15.8  
![](cid:footer-mobile-logo)  
---