Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Closed
mindscratch opened this Issue February 17, 2012 · 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
Owner

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 February 22, 2012
Commit has since been removed from the repository and is no longer available.
Brian Hempel
Owner

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

Craig Wickesser

@brianhempel this fix did not work

Brian Hempel brianhempel closed this in 724df5a February 23, 2012
Brian Hempel brianhempel reopened this February 23, 2012
Brian Hempel
Owner

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

@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 January 02, 2013
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.