jruby/warbler — Issue #73: Compiled war file failed to access SQLite3 database
Author: danielwu
Created: 2012-02-01 03:17:18+00:00
State: open

Hi,

I have successfully packaged a Rails app into a WAR file using warbler 1.3.2, and deployed using Tomcat 7.0.11. However, when I tried to use the compiled version of the WAR file (i.e. warble compiled war), the application gets stuck and I see the following error in the Tomcat log files:

Feb 1, 2012 12:10:52 PM org.apache.catalina.core.ApplicationContext log
INFO: Completed 500 Internal Server Error in 164ms

Feb 1, 2012 12:10:52 PM org.apache.catalina.core.ApplicationContext log
INFO:
NoMethodError (undefined method `objtype' for nil:NilClass):
app/controllers/customers_controller.rb:27:in `index'
app/controllers/customers_controller.rb:26:in `index'
app/controllers/customers_controller.rb:24:in `index'

The line that is causing the error is referring to an ActiveRecord object. 'objtype' is a column in the database table.

Note that it is not a total failure to access the database because queries were successfully executed prior to the above error. Also, if the above line is commented out, the error moves to the next ActiveRecord object in the code.

Here is a listing of the gems and their versions in my environment:

Gems included by the bundle:
* abstract (1.0.0)
* actionmailer (3.0.10)
* actionpack (3.0.10)
* activemodel (3.0.10)
* activerecord (3.0.10)
* activerecord-jdbc-adapter (1.2.2)
* activerecord-jdbcsqlite3-adapter (1.2.2)
* activeresource (3.0.10)
* activesupport (3.0.10)
* arel (2.0.10)
* bouncy-castle-java (1.5.0146.1)
* builder (2.1.2)
* bundler (1.0.21)
* daemons (1.1.4)
* delayed_job (2.1.4)
* erubis (2.6.6)
* i18n (0.5.0)
* jdbc-sqlite3 (3.7.2)
* jquery-rails (1.0.13)
* jruby-jars (1.6.6)
* jruby-openssl (0.7.5)
* jruby-rack (1.1.3)
* mail (2.2.19)
* mime-types (1.16)
* polyglot (0.3.2)
* rack (1.2.3)
* rack-mount (0.6.14)
* rack-test (0.5.7)
* rails (3.0.10)
* railties (3.0.10)
* rake (0.9.2)
* rdoc (3.9.4)
* rubyzip (0.9.5)
* thor (0.14.6)
* treetop (1.4.10)
* tzinfo (0.3.30)
* warbler (1.3.2)
* will_paginate (3.0.0)
* xml-simple (1.1.0)

There is not much extra information in the log files so it is difficult to know exactly what caused the error. How can I enable more logging information to be generated?

Any suggestions / hints would be greatly appreciated.

Thanks,
Daniel