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.

Tuesday, August 26, 2008

And what about Project Management?

Related to my previous post in which I expressed my desire to learn more "theory" about Java, I know that not only the path of the good developer is in front of me, but also the path of a good manager as well. Two sides of the same coin? The need to learn about resources and human skills ?
I know I have to do it, I think it's important for my career to learn it and if possible to be one. Some jobs have a mixed role between tech leaders, project leaders, project managers and such. Others don't.
In contrast to Java, this will be almost theory with no practice (Hello? Does anyone want to hire me as a manager? I know I can do it). Well, I do have certain background when I was leader at some projects for college, but that's the tip of the iceberg.

Some of the texts I'm going to read are:

  • Project Management Body of Knowledge
  • Behind Closed Doors - Secrets of Great Management
  • Some book about Agile. Not sure which one yet.
Yay! I think the book I bought about artificial intelligence featuring agents, backtracking, neural networks, markov chains, bayesian network and such won't be opened for a while. And this reminds me that I should keep more handy the book I used at college about algorithms and graph theory. That stuff is always useful (is it?)

Now for a poll! What's cooler: project management or artificial intelligence?

Java The Master

So, lately my main programming skills have been focused on the Java language. I programmed Java in my previous jobs and in my current one, and I think I'm able to become a "Java Senior". Nevertheless, I'm still being seen as a SemiSenior by companies, therefore I have a new quest: to master Java. This all started when I entered at Java Black Belt and I realised that there is so much I have to learn about.
How? not sure yet. As I usually worked in core technologies (usually for a backend server) now I'm going to learn what I should know:

  • A better understanding of the Spring Framework. The beans, the IOC, its MVC, if possible something with its aspects (comparison with AspectJ?)
  • A better understanding of Hibernate, ORM and JPA. Some people say you shouldn't write SQL anymore. Others say Hibernate won't fit complex requirements (or performance). Let's see and try.
  • The Struts Framework (second version). How does Struts makes my life easier? Let's build some nice server! Comparison with Spring MVC?
  • EJB 3: Is EJB obsolete? I don't know but it won't hurt to know something about it.
  • Servlets. Tomcat won't be a mistery anymore. Let's learn about web.xml! And the most interesting part: let's see how the servlets connects to http from one side and to an mvc or application server from the other side.
  • Ant! I used Ant several times, but now I have a 700-pages book about it, so something tells me there's a lot about Ant that I don't know (by the way, I need a Maven book!)
  • JTA: Do you know I love transactions? If I have to choose to work in an open source project, that would be the commons-transaction from Jakarta. Someone said XA?
  • JMM: A few days ago I read the JSR about Java Memory Model. Nice! Some crazy stuff may result if you don't properly synchronize your fields that are read by several threads. But really! Everyone in Java should read it! Search for JSR 133 and you'll find it.
  • SCJP: Aha! The top of the cream! I'm not sure if I'll take it but I should learn enough to be confident that I would pass it.
Of course, The most difficult task is to find the time to do all this stuff.

Sunday, November 18, 2007

Testing the Gibbon

For one of my college projects, I needed to test the performance of a network protocol named SCTP. To do that, I set up three different Linux machines. One to host the server, the second one to host a client and the last one to emulate the Internet. In my previous work I became familiar with Ubuntu, and seeing that it is so newbie-friendly, I continued to use it. So I installed Ubuntu in the project's machines. First it was Edgy, and then Feisty -yes, I have been working in this college project from two years ago-.

So far it was working perfectly, but there were issues in some of my last tests. Someone advised me that maybe the Internet simulator (using NetEm) needed 1000hz interrupts enabled in the kernel. And that the kernel 2.6.22 supported that. As Ubuntu 7.10 came with that kernel, I decided to upgrade the machines to this latest distro.

My main machine has a nice graphics card, so I installed its restricted drivers, and then Ubuntu enabled Compiz-Fusion. And oh boy it looks good! Loving the dock and Exposé of the Mac computer I use for my thesis, I installed a dock and configured Compiz to show windows like Exposé. Also a enabled the cube desktop (and set four viewports) and made it a bit transparent, to see all viewports at the same time. I spent several hours playing with all available options, until I reached a configuration that I liked.. and it's so beautiful! As I mentioned in another post, I am very happy with my customized XP box, but maybe Linux will become my main OS in the near future. Keep the good work!

Saturday, November 10, 2007

Transactional Collections

In my previous job, I was a Java developer and I was in a team that was building a Content Management System. Although there was a lot of exciting modules to work with, the ones I liked the most where a transactional map and a transactional file system.


The former was mostly used as a Cache system, where the transactional map was backed by a LRU map. We analyzed some of the Transactional Caches available in the moment, like JBossCache, but they were too much for what we needed, and in some cases they were buggy. In my opinion, once we finished it, it was an excellent map, better than the one offered by the Commons Transactions at that time. As a matter of fact, several times I thought joining the CT project to contribute by building different kind of transactional collections, like a set, sorted set, sorted map, a list, etc.

I thought about building a transactional sorted set or a list, and they seem more difficult as not only you have to keep the ACID properties for those objects added to the collection, but also keep their positions, and try to minimize the overhead.

Commons Transactions also offer a file system, but it doesn’t seem to comply with a XA interface - XAResource -. In my job both the map and the file system were managed by a JTA as they worked in conjunction with a database. Luckily, as the transactional map is a memory only collection, it isn’t necessary to keep a log and do some kind of recovery disaster in the case of a crash.

I wonder the status of transactional collections in other languages, like C++ or Smalltalk…