May 27, 2008

The Omen strikes again! JRuby on Rails on, yikes, Websphere.

Recently I kept my self busy, and highly frustrated trying to get a JRuby application working on WebSphere 6.1. The recipe was pretty straight forward: warble it and deploy it. Truthfully, there are a few steps that you need to be taken care of, such as configuring database.yml to point to the right place and making sure warbler.rb config file includes the proper jdbc-adapters, but that is all OK.

So, after trying the generated .war in Tomcat and confirming that it was working fine, it was time to hit WebSphere land, and guess what!, didn't work, duh!

The default web.xml configuration doesn't play well in WebSphere. The worst part is that there are no error messages, not even a trace in the logs to help.

The default web.xml spat out by warbler reads:


The filter doesn't work in WebSphere, but the servlet does the trick. So I changed the web.xml.erb within the installed gem to produce this:


Note that I've repeated the listener tag, it was intentional. WebSphere will complain if the listener declaration came after the servlet tag, it must be before, duh! again!

No comments:

Post a Comment