jarib / celerity

This project is no longer maintained.
http://celerity.rubyforge.org/
GNU General Public License v2.0
206 stars 38 forks source link

:resynchronize => true causes "java.lang.ref.WeakReference" with Marshal.dump #4

Closed jasonfranklin-stokes closed 15 years ago

jasonfranklin-stokes commented 15 years ago

browser = Celerity::Browser.new :resynchronize => true, :browser => :firefox, :log_level => :off browser.clear_cookies

browser.goto("http://www.monster.de/") page = browser.page file = Dir.pwd + "/page.dmp" File.open(file, 'w') {|f| f.write(Marshal.dump(page)) }

=> `marshal_dump': java.lang.ref.WeakReference (IOError)

removing the :resynchronize => true results in the marshal dump working properly. I guess that this has something to do with threading.

jarib commented 15 years ago

You can't rely on Java objects in JRuby being Marshal#dump-able, especially when they don't implement java.io.Serializable.

This request belongs to either the JRuby list ("why can't I dump WeakReferences") or on the HtmlUnit list ("why aren't pages serializable").