Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

mindscratch opened this Issue · 8 comments

2 participants

Craig Wickesser Brian Hempel
Craig Wickesser

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.

Craig Wickesser

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.

Brian Hempel

Thanks for the report! I'll try to have a fix up by the end of the week.

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

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

Craig Wickesser

@brianhempel this fix did not work

Brian Hempel brianhempel reopened this
Brian Hempel

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

Craig Wickesser

The reverted autoload is working just fine.

Brian Hempel

@mindscratch v3.0.5 pushed to rubygems. Thanks for your feedback!

Craig Wickesser

@brianhempel no problem, it's always nice to see the open-source process at work :) thanks for the library!

Brian Hempel 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.