Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web app deployment in Tomcat

Does Tomcat use a different Java Virtual Machine (JVM) for each web application running in its container, or does all web applications in Tomcat run under the same JVM?

So for a specific example: if a web application under webapps, enables JMX programmatically (via System properties) does this mean that JMX is enabled for all web applications running in the container?

I believe this is the case, but would like to confirm.

This question came up from my problem in this thread: question on tomcat and jmx. Any input on the subject is appreciated.

like image 763
Cratylus Avatar asked Apr 23 '11 13:04

Cratylus


People also ask

What is deployment in Tomcat?

Deployment is the term used for the process of installing a web application (either a 3rd party WAR or your own custom web application) into the Tomcat server. Web application deployment may be accomplished in a number of ways within the Tomcat server. Statically; the web application is setup before Tomcat is started.

What is Tomcat web application?

Apache Tomcat (called "Tomcat" for short) is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run.

Is Tomcat a web application server?

Apache Tomcat (Link resides outside IBM) is an open source application server that executes Java Servlets, renders and delivers web pages that include JavaServer Page code, and serves Java Enterprise Edition (Java EE) applications. Released in 1998, Tomcat is the most widely used open source Java application server.


1 Answers

Tomcat runs in a single JVM, so every app deployed to a single tomcat instance runs in the same VM as every other application. They get different classloaders, so they're isolated from each other in that sense, but the JVM is the same.

So any feature enabled JVM-wide will be enabled for every application in that instance.

like image 92
Joseph Ottinger Avatar answered Sep 28 '22 04:09

Joseph Ottinger