I'm on JRuby 1.4.0 (JDK version 1.6.0_17). The following code hangs my JRuby
on Rails app.
require 'net/http'
require 'timeout'
begin
Timeout::timeout(5) do
res =
Net::HTTP.get_response("http://localhost:8080/projects/1/email_approved")
res.body
rescue Exception => e
RAILS_DEFAULT_LOGGER.error e
RAILS_DEFAULT_LOGGER.error e.backtrace.join('\n\t')
end
Non-local URLs work; only local URLs hang. It works fine in MRI Ruby. I've
tried to resolve this for days with no success. Googling around, I found
that timeout.rb is not reliable in previous versions of JRuby, so I upgraded
to JRuby 1.4.0 but I still have this problem.
Could someone please help? It would be greatly appreciated. I am at a
complete loss.
Thanks!
--
View this message in context:
http://old.nabble.com/Net%3A%3AHTTP-hangs-in-JRuby-on-Rails-app---please-help%21-tp27181232p27181232.html
Sent from the JRuby - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email