jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3228

Some error saving to a Rails session [Marshalling bug?]

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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'

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jeff Sutherland added a comment - 11/Dec/08 12:21 PM

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.

  • Jeff Sutherland
Show
Jeff Sutherland added a comment - 11/Dec/08 12:21 PM 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.
  • Jeff Sutherland
Hide
Permalink
Robin Wunderlin added a comment - 17/Dec/08 8:30 AM

Thanks, works fine with string.

> It appears that JRuby 1.1.5 is not handling attributes that are objects in the session

Why is that so?

  • Feature?
  • Bug?
Show
Robin Wunderlin added a comment - 17/Dec/08 8:30 AM Thanks, works fine with string. > It appears that JRuby 1.1.5 is not handling attributes that are objects in the session Why is that so?
  • Feature?
  • Bug?
Hide
Permalink
Jeff Sutherland added a comment - 17/Dec/08 10:05 AM

It's a bug. RoR on standard Ruby can handle objects in the session. RoR on JRuby can't.

Show
Jeff Sutherland added a comment - 17/Dec/08 10:05 AM It's a bug. RoR on standard Ruby can handle objects in the session. RoR on JRuby can't.
Hide
Permalink
Nick Sieger added a comment - 04/Feb/09 1:13 PM

JRUBY-3289 may be related or possible the source of this bug.

Show
Nick Sieger added a comment - 04/Feb/09 1:13 PM JRUBY-3289 may be related or possible the source of this bug.
Hide
Permalink
Thomas E Enebo added a comment - 04/Feb/09 1:32 PM

This is NOT a minimal case (but I thought I would share it since I spent a minute trying):

{format}

require 'rubygems'
require 'active_support'

store = ActiveSupport::Cache::FileStore.new("/tmp")

class Foo
def initialize
@d = DateTime.now
@r = Rational(1,2)
end
end

store.write("foo", Foo.new)
foo = store.read("foo")
puts "Done #{foo}"


It is weird though...Beside the type of store wouldn't the bug really involve marshal.dump in some fashion not working for some types of objects?

Show
Thomas E Enebo added a comment - 04/Feb/09 1:32 PM This is NOT a minimal case (but I thought I would share it since I spent a minute trying): {format} require 'rubygems' require 'active_support' store = ActiveSupport::Cache::FileStore.new("/tmp") class Foo def initialize @d = DateTime.now @r = Rational(1,2) end end store.write("foo", Foo.new) foo = store.read("foo") puts "Done #{foo}"

It is weird though...Beside the type of store wouldn't the bug really involve marshal.dump in some fashion not working for some types of objects?
Hide
Permalink
Nick Sieger added a comment - 07/Feb/09 6:58 PM

I can't reproduce this with trunk as of 9058, it seems to be fixed. Please re-test, and if it still fails for you, please post a test case.

Show
Nick Sieger added a comment - 07/Feb/09 6:58 PM I can't reproduce this with trunk as of 9058, it seems to be fixed. Please re-test, and if it still fails for you, please post a test case.

People

  • Assignee:
    Unassigned
    Reporter:
    Robin Wunderlin
Vote (2)
Watch (1)

Dates

  • Created:
    10/Dec/08 9:57 AM
    Updated:
    27/Oct/09 1:48 PM
    Resolved:
    07/Feb/09 6:58 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.