Marshalling trouble with JRuby/Rails?
By realneel on Oct 18, 2007
If you are getting exceptions like the one below with JRuby and Rails, read on for the solution
Rendering /tmp/neel/jruby-1.0.1/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/ action_controller/templates/rescues/layout.rhtml (500 Internal Error) no marshal_dump is defined for class Java::JavaObject /tmp/neel/jruby-1.0.1/lib/ruby/1.8/pstore.rb:349:in `dump' /tmp/neel/jruby-1.0.1/lib/ruby/1.8/pstore.rb:327:in `transaction' /tmp/neel/jruby-1.0.1/lib/ruby/1.8/cgi/session/pstore.rb:81:in `update' /tmp/neel/jruby-1.0.1/lib/ruby/1.8/cgi/session/pstore.rb:88:in `close' /tmp/neel/jruby-1.0.1/lib/ruby/1.8/cgi/session.rb:324:in `close'The problem is that Rails is trying to store the Java object in the session store. The default session store is the filesystem, and it fails since it cannot marshal a Java Object. Setting the session store to use memory instead of the filesystem solves the problem.
In config/environment.rb set
config.action_controller.session_store = :memory_store