Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Don't use autload to bring in different session stores #9

mindscratch opened this Issue · 8 comments

2 participants


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.

@brianhempel brianhempel referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.

@mindscratch can you test against the jruby_tomcat_fix branch?

gem 'mongo_session_store-rails3', :git => '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

@brianhempel brianhempel reopened this

@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!

@brianhempel brianhempel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.