Tomcat Words Explained: Catalina, Coyote, Connector, Context, Valve, Poller

October 1, 2026 · How It Actually Works: Real Systems as State Machines (part 4)

▶ Watch on YouTube & subscribe to The Stack Underflow

The Tomcat state-machine video labels its boxes with words like Catalina, Coyote, Engine, Context, Valve and Poller. This primer explains each one first, with one running example: bookstore.war, deployed at /bookstore, and a browser asking it for book 42 on port 8080.

The one-line version: Coyote speaks HTTP, Catalina runs servlets, and everything in between is a box inside a box: Server, Service, Engine, Host, Context, Wrapper.

Last verified against the Apache Tomcat 11.0 documentation (version 11.0.26): 1 October 2026. Scope: Apache Tomcat 11, which implements Jakarta Servlet 6.1. Every claim links to its source at the bottom of the page.

One picture: Tomcat is a hotel

Every word gets a memory peg from one picture. The pegs are an analogy, a teaching aid, not a technical claim; where one breaks, the table says so. Your web apps are the tenants, and requests are the guests. The pegs chain the way Tomcat nests: the whole building, a wing, the entrance, the operations team, the street address, one tenant business, one service counter.

What Tomcat is

WordMemory pegWhat it actually is
Servlet containerThe hotelThe part of a server that provides the network services, decodes requests, formats responses, and manages servlets through their lifecycle (Jakarta Servlet spec). Tomcat implements a set of Jakarta EE specifications (Servlet, Pages, WebSocket and others), not the full platform.
Jakarta vs javaxThe renamed rulebookTomcat 11 implements Servlet 6.1, with classes in jakarta.servlet. When Java EE moved to the Eclipse Foundation the packages changed from javax.* to jakarta.*. Where the peg breaks: old code must be recompiled or converted, not just relabelled. javax code runs on Tomcat 9 and earlier.
CatalinaHotel managementTomcat’s servlet container: “A Server element represents the entire Catalina servlet container.” The same name is used for the startup class org.apache.catalina.startup.Catalina, the catalina.sh script and CATALINA_HOME.

Starting Tomcat: folders, files, first objects

WordMemory pegWhat it actually is
CATALINA_HOME / CATALINA_BASEThe chain’s blueprints vs one building’s setupHOME is the root of the installation (jars, binaries). BASE is the root of one instance’s runtime configuration: config files, logs, deployed apps. By default they are the same folder.
BootstrapThe manager who unlocksThe class whose main() starts Tomcat, shipped in bootstrap.jar. It builds class loaders, then loads Catalina. Not the JVM’s own “bootstrap” class loader.
Common class loaderThe shared storeroomLoads the jars in Tomcat’s lib folder, visible to Tomcat and to every web app. (By default the Server and Shared loaders are not defined, so Common is the one that matters.)
server.xmlThe building’s floor planconf/server.xml, “the main configuration file for the container”. Catalina parses it and creates the Server, Service, Connector, Engine and Host.
Server and port 8005The whole building; the staff-only phone lineThe Server represents the whole container and waits for a shutdown command: in the shipped file, the word SHUTDOWN on port 8005, which the stop scripts send. Port 8080 is for users. The peg breaks here: “staff-only” is not authentication; anyone who can reach the port and send the word can stop Tomcat.
ServiceA wing of the building”Ties one or more Connectors to exactly one Engine.” The shipped one is named Catalina. Not a Spring service and not a Windows service.

The container tree

This nesting is the most important picture in the deep-dive video.

WordMemory pegWhat it actually is
ConnectorThe entranceHandles communication with the client; each one listens on one TCP port. The default protocol HTTP/1.1 “uses a Java NIO based connector”.
CoyoteThe reception deskTomcat’s connector code: HTTP/1.1, HTTP/2 and AJP live in the org.apache.coyote packages. Coyote handles the protocol; Catalina runs servlets.
EngineThe operations team”The entire request processing machinery” of one Service: receives all requests from its Connectors and returns the response to the Connector. Exactly one per Service.
HostThe street addressA virtual host: a network name such as localhost. Its appBase defaults to webapps, and with deployOnStartup (default true) it deploys the apps it finds there when Tomcat starts.
ContextOne tenant businessOne web application, usually a WAR. bookstore.war gets the context path /bookstore; each request goes to the Context whose path is the longest prefix of its URI. Not Spring’s ApplicationContext.
web.xml / context.xmlThe tenant’s house rulesWEB-INF/web.xml is one app’s deployment descriptor (servlets, filters, listeners); optional when annotations declare the same. context.xml (the app’s META-INF or conf) holds Tomcat settings for a Context.
Per-webapp class loaderThe tenant’s private storeroomLoads WEB-INF/classes and WEB-INF/lib, visible to that app only, and checked before Common, except JVM classes and the Jakarta EE APIs, which are always delegated first. So two apps can bundle different versions of a library.
Wrapper and servletOne service counter; the servlet is the counter’s instructionsA Wrapper is Tomcat’s container for one servlet definition; it calls init() once and destroy() at the end. The servlet is your code.
JasperThe in-house print shopThe JSP engine (Jasper 2, Jakarta Pages 4.0). It compiles JSP pages into servlets and is itself a servlet, JspServlet. Plain servlets don’t need it.

Engine, Host, Context and Wrapper are containers. A Connector is not; it hands requests to one.

One request: GET /bookstore/books/42

  1. The browser opens a TCP connection to port 8080. On the default NIO connector, an Acceptor thread (peg: the doorman) accepts it and registers it with the Poller (peg: the concierge), which watches many open connections with one Java NIO selector instead of a thread per connection.
  2. When the request bytes arrive, the socket is processed on a worker thread (peg: the staff), from the connector’s private internal pool or a shared Executor.
  3. Coyote parses the request, and the CoyoteAdapter hands it to Catalina. Tomcat’s own docs describe this path: requests “start processing in an endpoint, then get passed to the protocol and then the Coyote adapter which is the common entry point for all servlet request processing.”
  4. The Mapper picks Host localhost, Context /bookstore, and the Wrapper for BookServlet.
  5. Each container has one Pipeline of Valves (peg: the corridor checkpoints; the AccessLogValve is the visitor log). The last, basic Valve of each level passes the request down a level.
  6. The Wrapper’s valve builds the filter chain (peg: the tenant’s front-desk check). Filters are application code that can inspect or change the request before the servlet and the response after it. Then BookServlet writes book 42.

Valves belong to Tomcat; filters belong to your app. A Valve sits in the pipeline of an Engine, Host or Context and is configured in Tomcat’s configuration; a filter is part of the Servlet API and ships inside your WAR.

The three capacity numbers

Connector attributeDefaultPegWhat it limits
maxThreads200The staffRequest-processing threads, so the maximum number of simultaneous requests (ignored if the connector uses a shared Executor)
maxConnections8192Guests allowed insideConnections the server will accept and process at any given time
acceptCount100The queue outsideThe operating system’s queue for new connections once maxConnections is reached

Where the peg breaks: the queue outside is kept by the operating system, not by Tomcat, and the docs add that “the operating system may ignore this setting and use a different size for the queue.” Guests inside may also be idle keep-alive connections waiting in the Poller, not requests being served.

Starting and stopping

  • Listener (peg: the tenant’s opening routine): a ServletContextListener is told when the web app starts and stops.
  • load-on-startup (peg: ready before opening): at deploy, the Servlet specification’s order is listeners’ contextInitialized(), then each filter’s init(), then servlets marked load-on-startup in the order of their values. Other servlets are initialized lazily, on their first request.
  • Lifecycle states (peg: the opening and closing procedure): every component from the Server down to each Wrapper follows the same twelve states: NEW, INITIALIZING, INITIALIZED, STARTING_PREP, STARTING, STARTED, STOPPING_PREP, STOPPING, STOPPED, DESTROYING, DESTROYED and FAILED. “Any state can transition to FAILED”, and FAILED is not always the end: stop() moves a failed component on to STOPPING and STOPPED.

Pause & Prove

1. All 200 worker threads are busy and 8192 connections are open on a default connector. Where does the next new connection wait, and how many can wait there?

  • Waiting for a free worker thread. Tempting: work on connections Tomcat has already accepted can wait for a thread. But a brand-new connection must be accepted first, and maxConnections is reached.
  • Inside the Poller. Connections already accepted wait there; this one hasn’t been accepted, because maxConnections is reached.
  • In the operating system’s queue, up to acceptCount, 100 by default. ✓ maxThreads 200 is the staff, maxConnections 8192 the guests inside, acceptCount the queue outside (and the OS may use a different size).
  • Nowhere: it is refused immediately. Only once the OS queue is full too may new connections be refused or time out.

2. Which part of Tomcat speaks HTTP on the network side? (Community poll)

  • Catalina. The servlet container: it runs servlets, after the protocol work is done.
  • Coyote. ✓ Tomcat’s connector code: HTTP/1.1, HTTP/2 and AJP.
  • Jasper. The JSP engine, which compiles JSP pages into servlets.
  • A Valve. Tomcat’s own per-container step in a Pipeline, after the request has already been parsed.

3. Peg drill

Say the peg for each before reading on: Coyote, Context, Poller, server.xml, Wrapper.

Answers: Coyote is the reception desk. A Context is one tenant business. The Poller is the concierge. server.xml is the building’s floor plan. A Wrapper is one service counter. The chain, building to counter, is Server, Connector, Engine, Host, Context, Wrapper.

Before / after this video

Sources

Checked on 1 October 2026 (Tomcat docs version 11.0.26, dated 9 Sep 2026), plus the video’s own verified sources:

Change notes

  • 1 Oct 2026: first published. Added two details from the HTTP Connector page that the video doesn’t spell out: the operating system may use a different queue size than acceptCount, and maxThreads is ignored when a shared Executor is used.

Not affiliated with or endorsed by the Apache Software Foundation. Apache Tomcat is a trademark of the ASF. Found a mistake? Tell us in the video’s comments and we’ll correct this page.

Found this useful? The deep version lives on YouTube — new breakdowns of how AI dev tools actually work, weekly.

Subscribe on YouTube →

Prefer email? Get the free newsletter: one failure, traced step by step, about once a week.