Thursday, September 30, 2010

Step One: Getting to know Tomcat and JBoss

Hello,

Like I've said in my first post, I'd like to list some problems that can happen when you are migrating from a Tomcat environment to a JBoss JEE environment.

But first, instead of going through all the problems you might have, I've decided that it would be best to work by example, so I will describe a simple Spring/JPA application that you can deploy in Tomcat.

Later we will describe a migration path from Tomcat 6 to JBoss AS 5.

The application will be a JSF application, using Spring as the IoC Container with annotations, component scanning, for persistence layer we will use Hibernate. For this example, we will not use the latest libraries, otherwise we would not actually have a lot of incompatibility, whereas the idea is to actually solve the issues.

Firstly we need to understand Tomcat, it is a Servlet 2.5 container, so it has no EJB3 support, JPA, JTA, ans so forth, it's a bare server, it is used a lot by developers because, since it is bare, we can debug and develop with greater speed than when using a full JEE compliant environment. Unfortunately, because it is not a JEE compliant container, developers that release production builds on Tomcat have to supplement the absence of the JEE container using third party libraries and frameworks, like Spring for IoC and Dependency Injection, Hibernate for JPA support, MyFaces and Richfaces for JSF support, JoTM for JTA, and so forth.

So, in one hand we have some freedom to use what we want with Tomcat, and on the other hand we need to have experience with a lot of things to guarantee a production level application.

When we go to JBoss, we have a much more restrictive environment (since 5.x) where we have strong enforcing of the specifications, and out of the box support for a lot of things that we would otherwise need. Unfortunately due to this restrictive nature, applications made to run with third party libraries tend to turn into a big headache when you want to migrate from one environment to the other, without changing a single line of code.

So, next post I'll start big introducing a simple project, that will be our "legacy" Tomcat project, and with each step we will advance, until we finally achieve a complete migration.

Until the next post!

No comments:

Post a Comment