i've spent the last three days trying to get a jruby/rails/couchdb app deployed to a linux/tomcat environment. i'm ready to shoot something. my current issue is this - there is a specific gem, "simply_stored", that acts at the top level driver for couchdb. whenever i hit code in the app that touches this gem, i get this ruby trace:
IOError in HomeController#index
closed stream
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored.rb:7
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored.rb:31:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored/couch.rb:5
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored/couch.rb:380:in 'load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:379:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:259:in 'require_or_load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:425:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in 'const_missing_with_dependencies'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/models/job.rb:2
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/models/job.rb:380:in 'load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:379:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:259:in 'require_or_load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:425:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in 'const_missing_with_dependencies'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in 'const_missing'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:437:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:96:in 'const_missing'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/controllers/home_controller.rb:3:in 'index'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in 'perform_action'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in 'call_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:in 'perform_action_with_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in 'perform_action_with_benchmark'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in 'ms'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in 'ms'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in 'perform_action_with_benchmark'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:in 'perform_action_with_rescue'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in 'perform_action_with_flash'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in 'process'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in 'process_with_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:in 'process'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:in 'call'
framework trace:
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.5.2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 'require'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in 'realtime'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in 'dispatch'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in '_call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in 'build_middleware_stack'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/head.rb:9:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/methodoverride.rb:24:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/lock.rb:11:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:36:in 'serve_rails'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:41:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:180:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/handler/servlet.rb:19:in 'call'
now, my initial reaction is that it's something to do with communication with couchdb. that's still possible, though unlikely. having a non-existent address specified has the same effect. this library works just fine for a number of people (including myself, in my dev environment - os x/WEBRick). digging deeper, i've found a few (rather scattered) references to similar issues, with different functionalities. here's one: http://stackoverflow.com/questions/815757/what-could-be-causing-this-rails-ioerror-closed-stream
the thing that's interesting is that both errors seem to happen in short order after the file is first loaded/processed by active_support. could this stream issue be related to the loading of the ruby files, and not the tcp connection stuff?
i'm completely at a loss here, any help will be greatly appreciated.
edit: interesting new tidbit - this issue goes away on the same config if using glassfish instead of tomcat. same server, same war file.