I just ran into an issue starting my JRuby on Rails app (which is deployed as a WAR file to a Tomcat server) that it couldn't load "mongo_mapper". This threw me for a minute b/c I use Mongoid and don't have any direct reference to mongo_mapper.
I found in mongoid_session_store-rails3.rb that autloading was being used (which was added as a pull request on issue #8).
The MongoSessionStore#collection_name= method ultimately ends up referencing the "MongoMapperStore" constant (defined by the autloading setup), which in turn ends up requring 'mongo_mapper', which I don't have installed.
I understand the autoload feature makes things a bit cleaner but it also causes things to break when you don't have all possibly used gems installed.
This issue only seems to occur when the Rails application is deployed to Tomcat, it seems to not be an issue when running under WEBrick. One thing to note is when the app is deployed to Tomcat its setup to use multiple threads.
Thanks for the report! I'll try to have a fix up by the end of the week.
@mindscratch can you test against the jruby_tomcat_fix branch?
gem 'mongo_session_store-rails3', :git => 'git://github.com/brianhempel/mongo_session_store.git', :branch => 'jruby_tomcat_fix'
It's a last ditch attempt to still allow autoloading. If it doesn't work, the autoloading can be reverted.
@brianhempel this fix did not work
Revert "Using autoload to require the different session stores" 66baa11…
… Fixes #9
@mindscratch I reverted autoload on the jruby_tomcat_fix branch. If you can confirm that fixes the problem, I'll merge into master and push a new gem version.
The reverted autoload is working just fine.
@mindscratch v3.0.5 pushed to rubygems. Thanks for your feedback!
@brianhempel no problem, it's always nice to see the open-source process at work :) thanks for the library!