Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: JRuby 1.1.6
-
Fix Version/s: None
-
Component/s: Application Error
-
Labels:None
-
Environment:jruby 1.1.6RC1 (ruby 1.8.6 patchlevel 114) (2008-12-03 rev 8263) [x86-java]
java version "1.6.0_11", Java(TM) SE Runtime Environment (build 1.6.0_11-b03), Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
Description
I migrated a existing Ruby on Rails-Project to JRuby.
Everything works fine except when I call "session[:last_view] = DateTime.now" in the application controller.
After this call I received the Msg: "Status: 500 Internal Server Error Content-Type: text/html".
This part worked well with RoR.
If I comment this call and delete the session in the browser, everything works fine.
Callback:
/Unable to render embedded object: File (\ FAILSAFE /) not found.\ Wed Dec 10 16:12:05 +0100 2008
Status: 500 Internal Server Error
) dump format error(
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:145:in `load'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:145:in `unmarshal'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/cookie_store.rb:102:in `restore'
C:/jruby/bin/../lib/ruby/1.8/cgi/session.rb:304:in `[]'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:134:in `session'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:166:in `stale_session_check!'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:114:in `session'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1131:in `assign_shortcuts'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/flash.rb:167:in `assign_shortcuts_with_flash'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:518:in `process'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_with_filters'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process_with_session_management_support'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
C:/jruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/bin/../lib/mongrel/rails.rb:76:in `process'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/bin/../lib/mongrel/rails.rb:74:in `process'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:159:in `process_client'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:158:in `each'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:158:in `process_client'
C:/jruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel.rb:285:in `run'
This is related to an issue I am having with JRuby 1.1.5. I am storing an object called PortalUser in my session. Here is a pretty print of the object in the session.
:portal_user=>
#<PortalUser:0x22c0
@address="999 W. Hamilton Ave #379",
@clear_password="9onb2cr",
@clear_password_confirmation=nil,
@email="lsdajflka@lsdajflsda.com",
@first_name="lajsdfl",
@id=0,
@last_name="aljdfslakj",
@lease_id=0,
@move_in_date=Tue, 08 Jun 2010,
@property_id=2,
@tenant_flag=true,
@unit_number="379",
@user_name="lsdajflka@lsdajflsda.com">
Note that @move_in_date is a DateTime object, not a string. When I redirect_to the next page, I get the following stack trace in my development.log.
/Unable to render embedded object: File (\ FAILSAFE /) not found.\ Thu Dec 11 10:55:50 -0700 2008
Status: 500 Internal Server Error
dump format error()
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/cgi_process.rb:184:in `stale_session_check!'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/cgi_process.rb:116:in `session'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1135:in `assign_shortcuts'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/flash.rb:166:in `assign_shortcuts_with_flash'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:523:in `process'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_with_filters'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process_with_session_management_support'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/jeffereysutherland/Development/rental_address/trunk/third_party/jruby/1_1_5/jruby-1.1.5/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
:1:in `start'
Googling the issue turned up this thread: http://www.ruby-forum.com/topic/172390
I changed @move_in_date to be a string, and my sessions started working again. It appears that JRuby 1.1.5 is not handling attributes that are objects in the session. My solution is to either make sure all my attributes in session objects are strings, or to serialize the object to YAML before putting it in the session.