Monday, August 15, 2011

Migrating from JBoss 4.3 to Jboss 5.1

In several of my previous jobs, which involved an enterprise application that ran on an application server, it usually was the one made by JBoss. The downside is that I know next to nothing about Websphere, Glassfish, and other competing servers, but the upside is that I'm pretty familiar with JBoss.

JBoss version 4, that is. And now, in 2011, I found out that the new project I'm working on, also uses JBoss 4. Yes, I know, it's Jboss 4.3 EAP, enterprise supported by Red Hat, which not long ago I found out is not the same as version 4.2, as the messaging system is different. But still, it just feels so old! JBoss AS is version 7 already, which I have to say, boots REALLY fast, and I've got the feeling that I'll be using JBoss 7 at work maybe in the year 2015.

Now, you'll say: but neither JBoss 6 nor 7 are not full JEE certified! They even haven't got EAP versions! (I think Jboss 7.1 will be EAP). So this time I focused on trying to run the current system on JBoss 5.1

This is not the first time I do this. That was last year, on another project, but couldn't succeed and ran out of time. Luckily this time I did have success. What happened last time was that the queues were in JBossMQ, and I didn't know how to migrate them to JBoss Messaging. This time, as the system runs in JBoss 4.3, it's already configured for JBoss Messaging, so that part was easy.

Also, the WARs used the Spring Framework, so there are no EJBs or EARs to convert. That also made the migrating process easier, although it made less sense to migrate, as it was only for the microkernel of JBoss 5, the JMS and the new version of JTA. No new EJB container nor Hibernate that mattered this time.

But still there were a few quirks:

  1. Classpath: One of the projects included a JAR library with JAXB implementation, and since that's included in Java 6, there was an exception because you had the same classes in different classloaders on the same hierarchy and JBoss 5.1 was picky about that.
  2. Libraries in SAR package: They needed to be in root of the SAR instead of in the lib folder. There is a workaround (or maybe it's the official way) by using jboss-structure.xml to specify where the libraries are, but haven't used that.
In conclusion: easier to migrate if you don't use the EJB stack, as I didn't have to deal with ejb-jar.xml, persistence.xml and the kind, but still not as easy or straightforward that I'd like to. I guess it won't be easier to move to JBoss 6 or 7, or even another application server. So much for standards...

Monday, August 8, 2011

Googlon

Today I solved the Googlon Quiz in order to enter the Google Developer Day here in Buenos Aires. Since I didn't have much time I used plain old Java. I think this particular exercise would have been much easier in Scala, had I known the language.


Speaking of Google, I received some interesting news that sadly I can't tell :)

Sunday, August 7, 2011

Different languages for the JVM

A few weeks ago I started learning Groovy and Grails. Even though I'm quite proficient with Java and the Spring Framework for building web pages, I wanted to know if Grails would lead me to an even faster way.

I downloaded a few examples and I have to say that I like the convention over configuration scheme of Grails, but was not so comfortable with Groovy's approach. I also tried Griffon as the supposed project had a client-server architecture and because of the requirements I wasn't sure if a web-based client was enough so I wanted to try a desktop alternative.

Griffon follows Grails conventions but seems less mature. Also, I found IntelliJ to be the best IDE (tried also STS and Netbeans) for Groovy apps.

In the meantime, the main subject for the Java User Group meeting that was coming was Scala. I'm lucky to have the, according to reviews, great book Programming in Scala, and will be starting reading it soon. I heard that having Scala it makes little sense to learn Groovy, so maybe a better use of my time will be to learn Scala and the Play Framework.

As a matter of fact, I was supposed to play with Scala today, but my procrastination lend me to install JRuby and Jython, and ended playing with the last one, after I learned that the popular Django framework was made in Python.

So I made a test web site following a Django-Jython tutorial, but it seems that there is little connection with the rest of the Java world. My goal was to convert the site to a web archive (.war), deploy it in JBoss, and connect Django with the JMS and the transaction manager. I don't know, maybe it's supposed to be used standalone.

I think I'll go back to Scala now.