views:

24

answers:

1

Hi All

I have a rails application deployed to jboss as a war packaged using warbler. The application has been working great for a while now.

I am looking to change the rails application so that rails, all gems and their dependencies are vendor'd. To that extent I have it working great and can boot the application locally using mongrel with no issues, and can also build the war with no issues

However when I deploy the war to jboss it fails to load the application successfully saying it cant find activerecord-jdbcmysql-adapter.

2010-10-26 14:20:23,281 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/lmd4]] (main) unable to create shared application instance
org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (no such file to load -- active_record/connection_adapters/jdbcmysql_adapter)

This is what i have done so far:

  1. Make sure config/warble.rb has an entry for activerecord-jdbcmysql-adapter

    config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]

  2. Manually unpacked the war and confirmed the gems are present

WEB-INF/gems/gems

drwxrwxr-x 7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x 3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x 4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x 7 4096 Oct 26 14:14 rack-1.1.0

WEB-INF/vendor/gems

drwxrwxr-x  7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x  5 4096 Oct 26 14:14 fastercsv-1.5.3
drwxrwxr-x 12 4096 Oct 26 14:14 hobo-1.0.1
drwxrwxr-x  7 4096 Oct 26 14:14 hobofields-1.0.1
drwxrwxr-x  4 4096 Oct 26 14:14 hobosupport-1.0.1
drwxrwxr-x  3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x  4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x  4 4096 Oct 26 14:14 json-1.4.6-java
drwxrwxr-x  2 4096 Oct 26 14:14 json-jruby-1.4.6-java
drwxrwxr-x  7 4096 Oct 26 14:14 rack-1.1.0
drwxrwxr-x  4 4096 Oct 26 14:14 will_paginate-2.3.15

I dunno what could be causing this but if anyone has any ideas please share?

JBoss 5 Rails 2.3.10 JRuby 1.5

Thanks

A: 

Could be a JBoss/JRuby-Rack interaction issue. We've had some reports in the past of this not working due to JBoss' use of VFS in class and resource paths and URLs. You could be tripping on this as well.

Can you try the same war file in Tomcat 6 to isolate JBoss as part of the equation? Then please post a bug at http://kenai.com/jira/browse/JRUBY_RACK or http://bugs.jruby.org/.

Nick Sieger
Thanks Nick. One thing I have picked up is that I also went from version 0.9.2 to 1.0.2 of activerecord-jdbcmysql-adapter. From version 0.9.3 the gem "name" ends in -java. When the gems are frozen the folder is now called activerecord-jdbcmysql-adapter-1.0.2-java vs. activerecord-jdbcmysql-adapter. I have rebuilt the war and doesn't fail on the activerecord-jdbcmysql-adapter anymore but another gem that ends in -java.
Typo I rebuilt the war on the 0.9.3 version of the gem and it passes loading activerecord-jdbcmysql-adapter