Jboss, Geronimo, or Tomcat?: Java Enterprise Features Comparison
Jboss, Geronimo, or Tomcat?: Java Enterprise Features Comparison
cgi
Sponsored by:
Open source Java EE application servers like JBoss, Tomcat, and Apache Geronimo easily stand up to their commercial counterparts, and
actually lead the market in innovation. All open source Java EE application servers are not created equal, however. In this article, Jonathan
Campbell compares JBoss 4.2, Geronimo 2, and Tomcat 6 based on features, deployment, and performance.
Java Enterprise Edition (Java EE) application servers are the Web-enabled standard when it comes to application development for the
enterprise. While there are commercial options, studies have shown that open source technology has become a familiar, if not essential, part
of the corporate IT infrastructure. JBoss 4.2, Geronimo 2, and Tomcat 6 are three widely used open source Java EE servers. Of the three,
JBoss and Tomcat hold the majority share of the market, although neither one is fully Java EE compliant. The fully Java EE compliant
Geronimo, meanwhile, is quickly gaining momentum. If you want to compete in the Java EE job market, you should be familiar with all
three of these open source servers and understand how they differ.
In this article I compare the three leading open source Java application servers based on features, deployment, and performance. I explain
why the various features found in each app server matter, and also offer some insight into where each server might fit into your enterprise
development architecture. My discussion includes commentary from Chantal Yang of Red Hat and Jeff Genender of the Apache Software
Foundation.
All three servers have been tested on Linux, Solaris, Microsoft Windows, and Mac OS X. JBoss has also been tested on HP-UX and AIX,
and Tomcat on AIX. You'll find more information about each of these features, and why they matter, following the table.
Geronimo 2 is the clear choice if your Java application needs are particularly extensive or if you just want to leverage total Java EE 5
compliance. Although JBoss 4.2 is not completely compatible with Sun's Java EE 5 standard, the JBoss 4.2 team is responsible for many of
the cutting-edge technologies used by all of the servers and added to the standard Java EE 5 capabilities. Tomcat 6 by itself is a lightweight
solution. It does not come with all the JEE features and additional packages found in JBoss and Geronimo, but also doesn't require much
memory and runs fast even on smaller servers.
1 de 5 19/12/2007 20:13
http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html http://www.javaworld.com/cgi-bin/mailto/x_java.cgi
Java EE 5 compliance
Java EE compliance is an important issue if your enterprise Java applications must be fully compatible with Sun's Java EE 5 server features.
Geronimo 2 is the only one of the three servers that is fully Java EE 5 compliant. JBoss 4.2 supports most Java EE 5 features, and Red Hat
will soon release JBoss 5, which will be fully compliant with Java EE 5. Tomcat is a JSP/servlet container that supports only basic Java
application server features.
Enterprise JavaBeans (EJB) is a Java component architecture for application development on Java EE servers. It allows you to package
functionality into reusable components. Earlier versions of EJB are considered to be difficult for development, even though it was intended
to be a development advantage. The new EJB 3 is supposed to solve the difficulties associated with earlier versions and offer some new
functionality. Both JBoss 4.2 and Geronimo 2 support EJB 3. Tomcat 6 by itself does not offer EJB 3 compatibility, but the Apache
OpenEJB project
can be embedded in Tomcat for EJB 3 support. According to Jeff Genender of the Apache Software Foundation, Tomcat can also run an
embeddable version of the JBoss EJB 3 container.
JSP/servlet features are the most basic capabilities for any Java server. JSP 2.1 and Servlet 2.5 are the new Java EE 5 versions of JSP/servlet
capabilities. JBoss 4.2, Geronimo 2, and Tomcat 6 all support these new JSP/servlet versions.
JavaServer Faces is a Java EE application-development architecture that makes development of Web-based user interfaces easier. Instead of
a request-driven MVC (model-view-controller) architecture, JSF uses a component-based approach. JSF 1.2, the current version, is
supported by JBoss 4.2 and Geronimo 2. JSF 1.2 runs on Tomcat 6 but problems have been reported.
Plug-in
support refers to an architecture for incorporating new functions and features into the server. JBoss calls its plug-in development features
MBeans (managed beans), and Geronimo has similar functionality, called GBeans. These custom beans provide a set of interfaces for
developing and managing custom resources that can in turn be reused as plug-in components.
With Geronimo, you can pick and choose from a plethora of components to build an application-server stack that fits your
needs. For example if you wanted to install the Liferay portal, or Apache Directory server, you would add the URL in the
management console and install the plug-in over the Net. The plug-in management system retrieves all of the dependencies that
are needed and installs those as well.
[t]he ability to make an application as light or heavy as you want it. You can use the full Java EE 5 stack which includes all the
components, or you can use Little G, which is just Geronimo with a Web container, or Micro G [...] which is just the Geronimo
kernel and a perfect base for SOA and ESB solutions. You can add and remove components, providing only the ones you want
to make use of. If you don't need EJB, you can simply remove the component from the console.
Chantal Yang of Red Hat says that JBoss 4 offers the advantage of an application server built "from the ground up using a micro-kernel
architecture." According to Yang, this enables JBoss to "plug in a variety of components to create a custom application server footprint."
Yang also stated that JBoss 5 and its micro-container will greatly improve on the plug-in support of MBeans. According to Yang, no other
application server has "such an evolved POJO-based micro-container at its heart."
Most every application is built around some set of business rules, also called business logic. A business-rules engine component can make
business-logic programming much easier to manage. In most programming, the if/then basic logic is all you have to work with. A business
rules engine lets you implement much more intelligent logic with ease. JBoss 4.2, Geronimo 2, and Tomcat 6 support Drools, a popular,
standards-compliant, and powerful business-rules engine. Although Geronimo is a fully Java EE 5 certified server that can run Drools, JBoss
has provided Drools support for three years as of this writing, making JBoss/Drools a stronger business-rules solution. JBoss has recently
rebranded Drools, naming it JBoss Rules. The Drools project itself started in 2001.
Hibernate
provides object-relational mapping (ORM) services for the Java language. Its easy-to-use framework lets you map an object-oriented model
into a traditional relational database, which is a powerful advancement for Java development. Put simply, Hibernate manages persistence by
allowing you to store POJOs in an SQL database of virtually any type. The SQL data access is then transparent to your application, making
application data and object management much easier.
2 de 5 19/12/2007 20:13
http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html http://www.javaworld.com/cgi-bin/mailto/x_java.cgi
Hibernate is an open source package, originally developed by a team led by Gavin King of JBoss. It now runs on many Java EE servers, and
works with J2SE as well. JBoss 4.2, Geronimo 2, and Tomcat 6 all support Hibernate 3.
JBoss Seam is a powerful application framework that unifies a number of Java and Web technologies such as asynchronous JavaScript and
XML (Ajax), JSF, EJB 3, Java Portlets, and business-process management (BPM).
Seam is a JBoss project, so JBoss 4.2 naturally supports it, as does Geronimo 2. According to the makers of Seam, they have ensured that
Seam applications can run on Tomcat using the JBoss embeddable EJB 3 container.
Clustering support
Clustering
is the term for running several parallel servers, all of which provide the same services, yielding what's often called "high availability":
because more clients can be supported by your cluster of servers, if one servers in the cluster dies, the other servers will still support the
clients. In the case of Java EE servers, the Java applications are still accessible even if one server in the cluster dies. Clustering provides
scalability for enterprise Java applications, improves performance, and eliminates a single point of failure.
JBoss 4.2, Geronimo 2, and Tomcat 6 all support clustering in some way. According to Chantal Yang, JBoss uses a "high-performance and
reliable clustering layer through buddy replication and fine-grained replication." On Geronimo 2, a patch made to correct clustering issues
was released recently, so there may still be some testing to be done with Geronimo on this point. If you are interested in using Geronimo
with clustering, consult the Apache Software Foundation.
Eclipse is arguably the most popular IDE for Java development, so integrating it with your Java EE server is one way to foster good
development. JBoss, Geronimo, and Tomcat all support Eclipse integration. JBoss has its own version of Eclipse, called Red Hat Developer
Studio, which is in beta at the time of this writing.
Deployment
Geronimo 2 really shines when it comes to general configuration and deployment. I found it a breeze to configure and deploy a Java
application through its Web console (see Figure 1 below). As Jeff Genender explains
The Geronimo console includes a lot of different wizards to help make the configuration of the application server as simple as
possible. Geronimo includes wizards that allow you to test database connection pools, security realms, etc. [...] Instead of
having to edit XML configuration, or stopping and restarting a server, you can walk through an easy to use wizard [... ]The
database connection pool wizard will even download most drivers right off the Internet for you, so you do not have to find the
proper driver for your database.
The Geronimo console also allows you to configure most features of its embedded Tomcat 6 container, without ever needing to touch an
XML configuration file.
3 de 5 19/12/2007 20:13
http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html http://www.javaworld.com/cgi-bin/mailto/x_java.cgi
JBoss 4.2 also has a nice-looking management console (see Figure 2), but it doesn't provide near the feature set of Geronimo. It primarily
gives you JBoss status and monitoring information, and it lacks deployment features. To deploy an application you simply copy it to the
default /deploy
directory, after which it is automatically and quickly deployed. Optionally, you can set your own custom deployment directory by specifying
it in the jboss-service.xml configuration file.
Tomcat 6 is quick and slim, true to form for a lightweight application server. It provides a nice Web console with the basic features that you
need (see Figure 3). You can start/stop and deploy/undeploy WAR applications from the Web-based Tomcat manager. It also provides most
of the status and monitoring information you would want. It has a good basic authentication system for the Web console too: you simply
specify users/passwords in an XML file within one of the Tomcat server directories.
Performance benchmarks
Along with reliability, performance is perhaps the most important feature for an application server. To benchmarks the servers, I did a
simple test with a JSP page and a compiled servlet to see how many user application sessions the servers would handle and how fast they
would connect users. Real-world Java applications are large. My test JSP and servlet were small, serving only to test the basic scalability,
reliability, and speed of these servers.
Using my dual-core 64-bit CPU server with 4 GB of RAM, I was able to get all three Java servers to run up to 1.2 million concurrent
sessions. That doesn't mean simultaneous connections, but it means maintaining concurrent unique user sessions that browser clients connect
to. I could surely have gotten more then 1.2 million if I had more memory.
4 de 5 19/12/2007 20:13
http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html http://www.javaworld.com/cgi-bin/mailto/x_java.cgi
The code used for gathering these benchmarks was a few hundred lines long. For accuracy, I used the same configuration for each server
test. With real-world Java EE applications, each session would maintain much more data then my test, so you wouldn't get the massive
numbers I did unless you ran a mid-range server with eight processors and lots and lots of RAM.
JBoss 4.2 did not do quite as well as Geronimo 2 because Geronimo is newer and uses more up-to-date internals. Tomcat 6 did the best of all
because it is a lightweight server specifically designed for JSP/servlet services, which is what I benchmarked. Tomcat takes 3 seconds to
start up compared to about 20 seconds for JBoss or Geronimo.
If these servers run out of memory, they are inclined to crash. I once had a Java: null pointer exception with JBoss 4.2 on trying to
shut it down, even though it hadn't run out of memory. Geronimo and Tomcat both seem to stall badly when they run out of memory, and I
had difficulty just shutting them down at that point.
In conclusion
I have installed and deployed Java applications on both commercial Java application servers (such as Sun's Java Application Server and
BEA WebLogic) and on open source alternatives. In my experience commercial application servers have more bugs than the open source
servers compared in this article, and they are more difficult to install. Deployment can also be an issue -- at least with the recent version of
Sun's Java Application Server.
Bottom line: JBoss, Geronimo, and Tomcat are reliable, fast, and definitely able to handle the traffic on large-scale enterprise applications.
Furthermore, many of the high-demand Java server technologies presented in the features comparison originate from the open source world,
not the commercial one.
In this article I've compared three popular open source JEE application servers based on features, deployment, and performance. The
features comparison should help you determine which of these open source options best suits the needs of your application environment, and
the performance benchmarks should help you round out your consideration.
Author Bio
Jonathan Campbell
holds more than 15 IT certifications and works as a project manager. He has been developing software for various flavors of Unix since the
late 1980s and for Windows since the mid 1990s. He also has expertise in network engineering and integration of Unix, Linux, and
Windows platforms. He has worked for various corporations and the United States government.
5 de 5 19/12/2007 20:13