Building .war with JRuby and warbler

390 Views Asked by At

I have been trying for hours to get a JRuby Rails application packaged as a war that actually works, without success... (JRuby 1.6.7, warbler 1.3.5, Rails 3.2.2)

Issue #1: Warbler seems to like to lump all libraries in one root folder rather than respecting the subdirectories they originally came from. For example, the Rails app itself runs fine but the war is broken when libraries are referenced as

require "lib/foo/bar.jar"
require "lib/baz.rb"

Mind you, foo/bar.jar and baz.rb are actually present in WEB-INF/lib, I just don't know how to configure Warbler to wire things up so the requires work right.

Issue #2: If I condescend to change all the requires to

require "bar.jar"
require "baz.rb"

, all is well if I build an executable war file, but if I try dropping the war into a Tomcat 6.0.20 installation, the application fails to initialize:

SEVERE: Error: application initialization failed
java.lang.NullPointerException
at org.jruby.RubyInstanceConfig$ArgumentProcessor.processArguments(RubyInstanceConfig.java:711)

No amount of Googling has shed light on what the problem is. Presumably the war is missing something or misconfigured somehow, but what is it?

1

There are 1 best solutions below

0
On

I can't say for sure this would cause your error - however I remember that there was a known bug between Jruby and Rails 3.2.x - which was apparently fixed in Jruby 1.7.

I had tried using Rails 3.2 with Jruby 1.6.7 before and came across this: JIRA-Ticket-JRUBY-3986

Hope that may at least help a little