Further Adventures with Glassfish and Ramaze
The JotBot Web site has been hosted on eApps for quite a few months now (8, I reckon). It's a mix of static pages created using Webby and some Ramaze backend code to handle transactions for license keys. Since Neurogami already had a server when taking over JotBot the plan was to move the code over and get off of eApps.
eApps was picked because they offered the Glassfish server out of the box, and that's how the server has been run. The ideas was to setup Glassfish on the Neurogami machine and just move the code over. Sadly, few things are so simple.Some of the complications came from wanting to use current versions of the libraries involved. That meant new Ramaze, new Rack, new Warbler, and possibly new Glassfish. As it turns out, these things do not all play nice together.I managed to get a proper war file generated from Warbler after creating a new version using updated jruby and rack jars. But I never got the results to run reliably with any version of Glassfish. The current Glassfish gem does not correctly handle Rack applications. It appears to work OK for very specific config.ru files, but falls apart, for example, if asked to use middleware. My guess is that testing has been following the "works OK for Rails" methodology. The issues have been pointed out to the developers, and I expect that proper Rack compatibility will eventually happen, but for the time being it is unusable for the JotBot server.So, the current move means dropping Glassfish and running jruby-rack with jruby-mongrel, proxied via Apache (which will serve the static files straight away).Interestingly enough, while the eApps instance has been super solid for the last many months, just now I've been seeing errors in processing transactions. I know from past experience that sorting these things out with Glassfish can be a black art. It's a trade -off: when Glassfish is doing well it can offer a number of useful services. But to get it running well can be quite tricky. This time, I decided to just skip fixing it and made the move to the new set up on the other box. My testing tells me all is order, and I really don't want to have to fight with an app server, so updated the DNS records and let it fly. I'm sure at some point I'll reevaluate Glassfish (and Tomcat, et al) for serving JRuby apps, but lean deployment is working for me.
Posted by neurogami

