Tomcat Bootstrap

Posted : admin On 1/25/2022
How do I debug a Dynamic Web Project using the Tomcat bootstrap?
Description: This tutorial describes how to use the Tomcat bootstrap jar to debug an Eclipse dynamic web project
Tutorial created using: Windows XP JDK 1.6.0_02 Eclipse Web Tools Platform 2.0 (Eclipse 3.3.0) Tomcat 5.5.20

Bootstrap loader for Catalina. This application constructs a class loader for use in loading the Catalina internal classes (by accumulating all of the JAR files found in the 'server' directory under 'catalina.home'), and starts the regular execution of the container.

  1. This tutorial will explain about how to use bootstrap script in AWS What is Bootstrap Script(Bootstrapping) in AWS? Bootstrapping allows us to write and put a startup script while launching an EC2 Instance so that it execute automatically as soon as the instance launch.
  2. To understand how Tomcat resolves classpath, take a look at this outline of the Tomcat 6 startup process: The JVM bootstrap loader loads the core Java libraries. Incidentally, this is the one place where environment variables do matter, as the JVM locates the core libraries using the JAVAHOME variable.

(Continued from page 2)

For testing purposes, I'll add a 'Howdy' message from the doGet() method of TestServlet.


Tomcat Bootstrap Templates

We'll need to add a Context entry to Tomcat's server.xml to tell TomcatSW the project's docBase and the URL path that should be used to access to project.

I'll create a Debug Configuration for the 'dynamic-web-test' project, specifying that org.apache.catalina.startup.Bootstrap is the main class (this is contained in the Tomcat bootstrap.jar file).

We can set the Working directory to be the home directory of our Tomcat installation.

Tomcat bootstrap 8

If we fire up our project in the Debug Configuration that we just created and then try hitting TestServlet in a web browser, you can see that we indeed can hit the servletW, since we are greeted by the 'Howdy' message.

In conclusion, it is quite easy to set up a Tomcat bootstrap debug configuration to run a Dynamic Web Project in EclipseSW. This technique is slightly more involved than setting up a Server configuration in Eclipse to run your project, but it is on the whole quite simple. Although features such as setting breakpoints in jsp's may not work if you run your project using the bootstrap method, working on your project on standard development tasks will typically be much smoother using the Tomcat Bootstrap class. The Server configuration is nice in terms of being able to click a couple times to run a web application, but it hides some project configuration details which can be annoying when you're trying to resolve difficult issues. The Bootstrap debug configuration technique covered in this tutorial exposes more details, which can simplify your debugging efforts. I recommend giving it a try. You may find that one technique works better for a particular task, and at other times, the other technique works better.

Tomcat bootstrap classpath
Page: <12 3

Tomcat Bootstrap

Related Tutorials:

Tomcat Bootstrap Download

  • Eclipse :: How do I debug my web project in Tomcat from Eclipse?