Rails app on Glassfish Gem - Cookie Session Store & Flash
---------------------------------------------------------

                 Key: JRUBY-4250
                 URL: http://jira.codehaus.org/browse/JRUBY-4250
             Project: JRuby
          Issue Type: Bug
          Components: Application Error, OpenSSL
    Affects Versions: JRuby 1.4
         Environment: Jruby 1.4.0, Rails 2.3.4, Glassfish Gem 0.9.5 (Same issue 
on Windows [Java 1.6.0_16-b01] and Linux [Java 1.6.0_12])
            Reporter: Jarred Nicholls


I switched to JRuby and started to experience this issue: I store a very 
lightweight activerecord object into the flash store sometimes (please hold 
back the flames, this bug shouldn't occur regardless) when reloading a form 
after a record fails validation. After the first ActiveRecord object is stored 
into the flash, I start to receive this error indefinitely (anytime I access 
the flash):

The error occurred while evaluating nil.[]
C:/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/flash.rb:111:in
 sweep' 
C:/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/flash.rb:110:ineach'
C:/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/flash.rb:110:in
 sweep' 
C:/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/flash.rb:164:inflash'

I looked at that line and it's accessing an instance variable of FlashHash 
named "@used", which stores all the used flash keys. That instance variable is 
nil on every request after storing an activerecord object into the flash hash. 
Now, it might be a session store issue as I am using the cookie store (I 
haven't tried other stores yet).

I'm thinking maybe JRuby and JRuby-OpenSSL is having problems dealing with 
serializing and deserializing activerecord objects in the cookie store? Anyone 
ever ran into this problem? If I delete my session cookie, the problem goes 
away until the next storage of an activerecord object into the flash.  But, I 
tested a partially filled object and it worked fine, it's only when it's 
storing a particular makeup of an object.  The issue doesn't exist in MRI Ruby, 
so it's definitely something with JRuby and possibly OpenSSL HMAC digest.

I was very excited to commit to JRuby for true multithreading, but I will go 
back to trying to make 1.9 SVN work :-P

Thanks,
Jarred

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to