Vita Rara: A Life Uncommon

Kicking the JBoss Habit: JBoss, JPA and Spring? Or Spring and JPA?

Categories: | | | | | | |

Hi, my name's Mark and I'm a JBoss user.

Ok now everyone.... "Hi Mark."

I have been a JBoss user for many many years. It all started with the seductive siren of Enterprise Java Beans. I still have a deployed application running on 2.4.3, or something like that. (Behind a firewall, thank heavens.) Well, today I took a few more solid steps toward kicking the JBoss habit.

If you've followed this blog you'll remember that I'm working on an ERP application for a client, Quadran. Yesterday I fought with query issues and JSP reloads for hours. With JBoss it's compile, package, re-deploy, wait. Change a few characters, compile, package, re-deploy and wait! It finally got to me.

I'd seen the light a while ago, when I started playing with Struts 2 and their Maven "Kick Start" archetype, which incorporates Jetty. It's simple, build your app, mvn jetty:run, and edit your JSP until you're happy, all without the need to reload the whole application. If you rebuild and change a class Jetty just reloads, and quickly.

Problem was my build system was ant based, and I have only used JBoss since about 2000. Hard to believe that's seven years. (I remember when there were ads for Java Programmers, seven years experience wanted, back in about 1997 to 1998, lol.)

Ant and JBoss have been my tools. I know them cold. They have worked very well for me, but... isn't there always a but? With the advent of JPA and my adoption of Spring, IOC, POJO based development, etc., JBoss has become peripheral to my development. I was mostly using it to run a Servlet container. I wasn't using any of its services: messaging, JMX, Session Beans, Quartz, declarative transactions, etc. I had slowly turned into a Spring guy, and I was tired of not being agile. I want out.

Anyway, Quadran, got big fast. Over 113 actions, some of them work flows with multiple steps, a sizable service bean layer, and a growing data layer. Layer JSP files on top of that, plus my build environment, and moving to another application server was daunting. I also wanted to kick ant when I made the move.

So, I'm slowly kicking my JBoss habit. In the process I'm also kicking my ant habit too. (I've had a huge crufty ant build file that I've been carrying around with me for about four years now. It's painful to maintain, fragile, etc.)

Today, I reworked my project to use Maven for its build. This took a while. Mostly just resolving dependencies, and adding jar files that aren't automatically downloaded via the various repositories. At the same time I moved Quadran from an ear based deployment to a war based deployment using Spring to manage my JPA environment using the Hibernate wrapper.

All in all after a few bumps and scrapes it all seems to work. Getting the Jetty plugin working was vexing. I was getting SAX errors when parsing my persistence.xml file. They just went away, and haven't come back for the balance of the day. It also threw some NoSuchMethodError's when processing tag libraries. Some transitive dependency seems to have tripped me up.

Anyway, I'm kicking my JBoss habit, even if I'm a little slow. I guess I'm a Spring and JPA guy now.