There are many ways to expose a Java web application to the consumer: application container (JBoss etc), servlet container (Tomcat etc), OSGi (Knopflerfish etc), self-executable WAR (Winstone etc) and so on. Are there any clear considerations where one approach should be favoured over another?

As an example, could a collection of self-executable WARs running as raw Unix processes outperform the same applications deployed within Tomcat taking into account administration and scalability concerns?

1 Answer 1


I dont have a formalized view of considerations as such but can list some factors in making the decision:

Redeployment - Frequent redeployment causes problems in EARs with memory fragmentation so how often will we need to be releasing updates. Will these need an outage on the servers (if deployed on JBoss/Weblogic)?

Shared Resources - Access to shared resources such as JDBC etc if bundled in the same EAR. Will these cause contention and can I make changes to one without affecting the other? Usually all WARs will get affected by changes made at the EAR level.

Upgrades to servers - Deploying with Tomcat and so on requires a possible upgrade to the base web container to take advantage of new Java/server features when available. Example Tomcat 6 to 7.

Size - Downloadable size of installation package if distributing container along with application. How large should we keep it?

Control over configuration - Internal config within my app plus access to config.xml or server.xml on the underlying containers. Do we want clients to edit these? or do we bundle all these in with preferred settings?

Memory footprint - Full blown servers obviously need more Heap (Xmx) than a Winstone app

What is client already running - Existing servers in their data centre could be re-used if Weblogic or Tomcat infrastructure already in place (for example).

Cluster requirements - will an additional performance requirement require adding servers into a cluster? How good is JBoss clustering versus running on Tomcat and what is the impact on the application code in clustered environment w.r.t. caching etc ?

  • +1 for a good list. It might be worth fleshing out the differences between application servers, and servlet containers and when one is favoured over the other a little more. Upgrades to application servers are often slow to come about in enterprises due to the impact on legacy code, having a bunch of Winstone/Jetty executable WARs can mitigate this by allowing some to run on Jetty6 others on Jetty7 depending on their NIO needs for example.
    – Gary
    Apr 12, 2012 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.