viernes, julio 02, 2010

Comparación entre Tomcat6 , Jboss y Geronimo

Tomado de:
Comparación entre Servidores EJB - Enlace en Ingles

Three open source Java application servers compared

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.

Java enterprise features comparison

Table 1 offers a snapshot view of how JBoss 4.2, Tomcat 6, and Geronimo 2 compare in their delivery of Java EE features. Note that features marked partial are not completely supported by the server, requiring you to install additional packages. If a feature is marked available you must install a third-party package to use it.
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.

Table 1. Java EE feature comparison

Feature JBoss 4.2 Geronimo 2 Tomcat 6
Java EE 5 compliance Partial Yes No
EJB 3.0 capable Yes Yes Available
JSP 2.1 and Servlet 2.5 capable Yes Yes Yes
JavaServer Faces 1.2 support Yes Yes Available
Custom plug-in support Yes Yes No
Business-rules engine support Available Available Available
Hibernate 3.x support Yes Available Available
JBoss Seam support Yes Yes Available
Clustering support Yes Yes Partial
Eclipse IDE connector support Yes Yes Yes
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.
Now, let's look at why these features matter.

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.

EJB 3 (Enterprise JavaBeans) capable

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 2.1 and Servlet 2.5 capable

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.

JSF 1.2 support

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.

Custom plug-in support

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.
Geronimo takes plug-ins a step further, according to Jeff Genender:
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.
Geronimo also has custom assemblies, which Jeff summarized as
[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."

Business-rules engine support

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 3.x support

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.
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 support

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 IDE support

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.

Installation and deployment

Installation notes
Tomcat 6 and JBoss 4.x are packaged in a tar file using GNU's tar command. Solaris, Mac OS X, and other Unix systems with a non-GNU tar command will not be able to expand the GNU tar file. Solution: simply get the GNU Tar program. Geronimo has downloads specific for non-GNU Unix-type systems, so you won't encounter this problem with Geronimo installs.
Installing all three of the Java servers under test is extremely easy. Aside from expanding the downloaded zip or tar package, all you need to do is set the JAVA_HOME environment variable to point to your Java 1.5 installation. You must set this environment variable before running the startup or shutdown scripts to start and stop these servers. Note that with Linux/Unix systems you might need to issue a chmod command to give execute permissions to the scripts.

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.
Geronimo Web console

Figure 1. Geronino Web console (click for larger image)

 Boss 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.

JBoss Web console

Figure 2. JBoss Web console

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.
Tomcat Web console

Figure 3. Tomcat Web console

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.
Figures 4 and 5 show the benchmark results.
Benchmark 1: Starting massive quantities of JSP sessions

Figure 4. Starting massive quantities of JSP sessions

Massive hits on a servlet that checks the sessions created in 
Benchmarks 1

Figure 5. Massive hits on a servlet checking the sessions

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.

About the author

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.

 Tomado de:

Comparacion entre Tomcat6, Jboss, Geronimo y Glassfish


Four open source Java application servers compared

Posted by kalali on December 11, 2007 at 1:11 PM PST
I was looking at feeds that my email client fetched during the day and I find am interesting one which lead me to an article written by Jonathan Campbell. Article can be found at http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html
Jonathan compared 3 different application server/ servlet container by thier support of Java EE 5 and some other factors. article explained about each feature that he compared application servers based on it. Jonathan did not included GlassFish in his review of "open source Java application servers" and only included 3 application servers/ Servlet containers including Tomcat, Jboss and Geronimo. :-), So I thought I should include some facts here in order to make the comparison fair to all parties.
Including Glassfish into Jonathan matrix will give us the following table: *Notice*
Feature JBoss 4.2 Geronimo 2 Tomcat 6 GlassFish 2
Java EE 5 compliance Partial Yes No Yes
EJB 3.0 capable Yes Yes Available Yes
JSP 2.1 and 2.5 capable Yes Yes Yes Yes
JavaServer Faces 1.2 support Yes Yes Available Yes
Custom plug-in support Yes Yes No ?
Business-rules engine support Available Available Available Available
Hibernate 3.x support Yes Available Available Yes, based on below description
JBoss Seam support Yes Yes Available Yes
Clustering support Yes Yes Partial Yes
Eclipse IDE connector support Yes Yes Yes Yes

Following descriptions further explain some of what Glassfish can provides in relation of the above table
  • GlassFish fully support Java EE 5 with all its related JSRs like JSP 2.1 (JSR 245), Servlet 2.5(154), EJB 3.0(JSR 245), etc.
  • GlassFish support clustering and cluster management out of the box, a cluster can be configured from both CLI and Administration console.
  • GlassFish administration console allows you to configure your load balancer :-), for example you can configure a Sun Java Web Server which works as load balancer to add or add/ remove an instance from its list of servers, either manually or automatically if a new node joined the cluster or removed from the cluster
  • GlassFish allows you to manage resources for entire cluster at once instead of applying them for each instance, for example you can deploy a web application into a cluster of 10 instances instead of deploying it seperately for each instance.
  • GlassFish has a very wide array documentation both from Sun Microsystems (for free) and from GlassFish community.
  • GlassFish installation is as easy as executing 2 commands.
  • Deploying applications into GlassFish or even an entire cluster of glassfish instances is just 2 clicks away.
  • Quality of GlassFish components is out of any question, Metro is well known for supporting new WS-* standards, EJB support uses Toplink Essentials, MQ server is Sun open sourced MQ, etc.
  • GlassFish has very good interoperability with some other open source projects like, OpenESB and OpenSSO which allows you to have what you need to kick start your J2EE application without looking at any additional configuration.
  • Certainly performance is something which everyone should have in mind before considering other feaures, take a look at http://www.spec.org/jAppServer2004/results/res2007q3/jAppServer2004-2007... and http://weblogs.java.net/blog/sdo/archive/2007/07/sjsas_91_glassf.html to find out more about how much capable GlassFish is.
  • GlassFish has connectors for both Eclipse and Netbeans, although other mentioned servers have a connector in Netbeans and Eclipse.
  • Seam support is available from GlassFish 1 upward.
  • Business rule engine support is available from OpenESB project integration.
  • About hibernate support, I cannot understand whether Jonathan means to use Hibernate as a persistence provider or plainly as an ORM, by the way both of this ?features? are available for GlassFish users.
  • GlassFish has an Update center, which allows you to update your application server from a remote repository.
  • GlassFish runs on all mentioned platforms, from Windows to AIX (Glasdfish 2 update 1 runs on AIX) and there is no restriction for you to run it on your platform of choice.
Mentioned items are in relation to what orginal article tried to compare. GlassFish can be used by a ROR developer by its integration with first class ROR IDE (Netbeans 6), It can serve you VOIP and SIP requirement by means of sailfin,etc. Any user with any kind of requirement will find GlassFish a suitable application server.
Although Jonathan did not mentioned GlassFish directly, but he gives his opinion by writing: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. The article could be more complete if Jonathan included GlassFish in his comparsion chart and at then end he could write that GlassFish has problematic deployment procedure

An statement which looks odd to me is: 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., Althogh it will be a complex procedure to setup a Cluser of Websphere (as a commercial application servers ) using websphere XD, Object Grid, and other available packages that faciliate enterprise scale deployment of Websphere, but WebSphere has a decent performance and reliability which is very hard to deny.
Notice: Some parts of this table taken from Jonathan Campbell article published by javaworld and is available at http://www.javaworld.com/javaworld/jw-12-2007/jw-12-appservers.html


No hay comentarios: