Java Enterprise Edition 5 (Java™ EE5™) is a programming platform for developing and running distributed, multitier Java applications. The developed application is run on one of the Java EE containers. Two containers implementing the same specification makes it possible to seamlessly migrate an application which has been developed for one application server to run on another application server. However there are some intricacies involved due to difference in classloader mechanism, application packaging, use of native code, deployment plans etc.
In this article we introduce the two application servers and their architectural differences and similarities. Then the Migration Articles section illustrates the steps involved in migrating an application developed for JBoss Application Server to WebSphere Application Server Community Edition (hereafter Community Edition). First, we’ll give a high level introduction to the two application servers
JBoss application server is Java Enterprise Edition 5 (Java EE5) compliant application server for application development, testing and deployment, created by Red Hat. Note that as of this date JBoss v5 has been released at jboss.org, but the RedHat JBoss v5 has not been fully released. The migration of JBoss v5 should be similar.
Community Edition is a Java Enterprise Edition 5 (Java EE5) certified application server based on Apache Geronimo. It comes pre-packaged with the following open-source components, to mention just a few:
- Apache Derby for the default database server
- Apache OpenJPA for the persistence engine
- Apache OpenEJB for the EJB Container
- Apache Tomcat for the Web Container
- Active MQ for the messaging provider
The Geronimo kernel is the core of Geronimo, which acts as the glue to plug-in any open source components.
Some high level features of Community Edition include:
- Java Support - IBM and Sun Java
- Platform Support - SUSE , Ubuntu, Red Hat and Asianux Linux, AIX, Sun Solaris, Windows XP, 2003, 2008 and Vista
- Database support - Apache Derby, IBM DB2, IBM Informix, MySQL, Oracle, Microsoft SQL Server (any JDBC compliant database can be used)
- Messaging support - Apache ActiveMQ, WebSphere MQ
- Directory Server Support - Apache Directory Server, IBM Tivoli Directory Server, Microsoft Active Directory Server, Open LDAP Server, Sun One Directory Server
- Small footprint- It’s easy to get started with Community Edition—the download is only around 100 MB, so developers can easily download it and get going. Community Editions’s small size also means it’s easy to embed in a larger stack, which helps both customers and ISVs build a total solution using Community Edition.
- Centralized configuration and control - Community Edition provides monitoring support through the administrative console. Using this feature, you can gather statistics and performance data for multiple servers and display them graphically to users.
- Portability to WebSphere Application Server family - Your investment in WebSphere Application Server Community Edition increases in value over time as the open-source community continues to mature and innovate. Also, WebSphere Application Server Community Edition gives you access to the comprehensive and proven portfolio of WebSphere middleware products. As your needs grow over time, IBM can provide a clear path to advanced capabilities such as SOA through WebSphere Application Server configurations.
- Liberal product license - Free to use in development, testing and deployment
- Free 30-day trial support - Community Edition offers 30 day trial support, which can be utilized by customers to get a feel for the advantages of IBM Support.
- Eclipse Plug-in for application development, testing and deployment
- An open forum for all your queries and questions – You can post any of your queries to the IBM developerWorks forum for Community Edition.
Architectural differences and similarities
The following section shows the architectural diagrams for Community Edition and JBoss Application Server.
Figure 1. Architecture diagram for Community Edition
Figure 2. Architecture diagram for JBoss Application Server
Table 1 describes the major differences and similarities between JBoss Application Server and Community Edition:
Table 1. JBoss and Community Edition feature comparison
|Enterprise Java Beans (EJB)||Supports EJB 3.0 specification||Supports EJB 3.0 specification|
|Java Connector Architecture (JCA)||Supports JCA 1.5 specification||Supports JCA 1.5 specification|
|Java Servlets||Supports Servlets 2.5 specification||Supports Servlets 2.5 specification|
|Java Server Pages (JSP)||Supports JSP 2.1 specification||Supports JSP 2.1 specification|
|Java Server Faces (JSF)||Supports JSF 1.2 specification||Supports JSF 1.2 specification|
|Transactions||Supports XA, local and no transaction||Supports XA, local and no transaction|
|JTA implementation||Support for JTA through JBoss JTA||Transaction support provided through ObjectWeb JOTM and HOWL|
|Connection pooling and management||JBossCX framework||Custom Geronimo code through Codehaus TranQL|
|WebContainer||Apache Tomcat 6.0||Apache Tomcat 6.0.20|
|EJB Container||JBoss own implementation||Apache OpenEJB|
|Persistence Provider||Hibernate||Apache OpenJPA|
|EJB application Deployment Descriptor||Configured in jboss.xml||Configured in openejb-jar.xml|
|Web application deployment descriptor||Configured in jboss-web.xml||Configured in geronimo-web.xml|
|EAR application deployment descriptor||Configured in jboss-app.xml||Configured in geronimo-application.xml|
|JPA deployment descriptor||Configured in persistence.xml||Configured in persistence.xml|
Common migration issues
This section discusses some of the most common migration issues that you might encounter.
Differences in Java EE implementations
During the migration process we have encountered problems caused by differences in how the Java EE specification is interpreted by vendors. For example a few application servers are not as strict as the WebSphere family of products in validating Java EE applications and at times deployment descriptors fail validation. Another example is use of single and double quotes in JSP which fails during compilation for WebSphere family of products.
Class loader related problems
The Java class loader is responsible for locating and loading classes. Application server class loaders are complex and so is the task of tracking down and solving these issues. Each Java EE application server uses a custom implementation of class loaders, because the Java EE specification does not currently cover class loaders. For example Community Edition has a parent-child classloader hierarchy, whereas JBoss uses a unified classloader approach.
These are libraries that are made available to multiple applications or the whole server. Shared libraries are located in different places and configured differently from server to server. For example in Community Edition there are a couple of ways to configure shared libraries:
- Within the application server directory, add a dependency to the shared library in the deployment plan.
- Outside the application server directory, add a GBean to the deployment plan.
- In JBoss, add an entry for the library-directory in the JBoss-specific deployment plan.
Each platform is bundled with a unique set of frameworks and libraries, for example Apache Xerces and Apache Xalan. The versions of these libraries and the class loaders are different for each platform.
The Java EE specification does not cover all the aspects of application deployment and configuration. This is why we have vendor-specific deployment descriptors. Each application server uses a different set of files; this is because they are implemented differently and have different feature sets. As mentioned in Table 1 the names of the deployment plans used by JBoss are different from those used in Community Edition. For example, JBoss calls the Web application deployment descriptor
jboss-web.xml, whereas Community Edition calls it
geronimo-web.xml. There may also be considerable difference between the schema definitions that are used to validate each of the deployment plans.
Packaging is important from a portability and migration point of view. Each application is packaged differently. This, combined with the different class loader implementations in each application server, can potentially create problems when migrating. To avoid problems, always follow the Java EE specification, which contains specifications for application packaging. An application is usually packaged into an EAR file, which can consist of the following modules:
Contains the EJB class files and deployment descriptors.
Web application module containing deployment descriptors.
A JAR file can contain common classes used by other modules and deployment descriptors for a Java EE application client.
Resource Adapter archives is a JAR file containing resource adapters for the J2C architecture.
Use of native code
The Java platform allows the use of native code, for example written in C or C++, with the use of Java Native Interface (JNI). Using native code can potentially cause problems when migrating to a different operating system. For example an application running on Windows may use .DLL files whereas if you migrate to a Linux platform the same application may require a .SO file.
JBoss has added JBoss-specific server extensions (JBoss Jars) to enhance some application features. These extensions would need to be resolved to their Java EE specifications.
The migration steps outlined in the articles listed below will help you understand the intricacies discussed above, and will help you migrate your JBoss applications to Community Edition.
- JBoss to Geronimo - Servlets and JSPs Migration
- JBoss to Geronimo - JDBC Migration
- JBoss to Geronimo - Hibernate Migration
- JBoss to Geronimo - EJB-Session Beans Migration
- JBoss to Geronimo - EJB-BMP Migration
This article explained how to migrate your code from JBoss Application Server and deploy it to WebSphere Application Server Community Edition. The sample applications provided in the migration articles highlight some of the notable differences between the two implementations.
Thanks to Ron Staerker for reviewing this material.
- Best Practices Tomcat to Geronimo Migration
- What’s new in WebSphere Application Server Community Edition V2.1
- Developing JPA Applications with WebSphere Application Server Community Edition
- Community Edition support site
- WebSphere Application Server Community Edition documentation
- WebSphere Application Server Community Edition samples
- WebSphere Application Server Community Edition trial support
- Apache Geronimo site
- Develop applications on all the Java EE5 APIs
- Get to know Java EE 5
- Clustering in Community Edition
- Apache Geronimo samples
- WebSphere Application Server Community Edition Technical Support offerings
- WebSphere Application Server Community Edition resources
- WebSphere Application Server Community Edition developerWorks space
- developerWorks Open Source zone