write_headers exception in rack/servlet_helper
----------------------------------------------
Key: JRUBY-2620
URL: http://jira.codehaus.org/browse/JRUBY-2620
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1.2
Environment: jruby-rack-0.9
Reporter: Morten Christensen
Assignee: Thomas E Enebo
The following works in normal cruby or jruby with webbrick but fails when
running in a java container (such as glassfish or jetty-rails).
To reproduce the problem try adding the following code to application.rb in a
rails 2.02 project:
before_filter :set_cache_header
def set_cache_header
# set modify date to current timestamp
response.headers["Last-Modified"] = CGI::rfc1123_date(Time.now - 1000)
# set expiry to back in the past
# (makes us a bad candidate for caching)
response.headers["Expires"] = 0
# HTTP 1.0 (disable caching)
response.headers["Pragma"] = "no-cache"
# HTTP 1.1 (disable caching of any kind)
# HTTP 1.1 'pre-check=0, post-check=0' (IE specific)
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate,
pre-check=0, post-check=0"
end
rack break fatally with this exception (which is also not very useful - it
would f.x. be nice with a trace to the offending method in application.rb !!):
file:/Library/Java/libs/jruby-1.1/lib/ruby/gems/1.8/gems/jetty-rails-0.4/lib/jruby-rack-0.9.jar!/jruby/rack/servlet_helper.rb:51:in
`write_headers': #<NameError::Message:0x4cc163ce> (NoMethodError)
from
file:/Library/Java/libs/jruby-1.1/lib/ruby/gems/1.8/gems/jetty-rails-0.4/lib/jruby-rack-0.9.jar!/jruby/rack/servlet_helper.rb:44:in
`each'
from
file:/Library/Java/libs/jruby-1.1/lib/ruby/gems/1.8/gems/jetty-rails-0.4/lib/jruby-rack-0.9.jar!/jruby/rack/servlet_helper.rb:44:in
`write_headers'
from
file:/Library/Java/libs/jruby-1.1/lib/ruby/gems/1.8/gems/jetty-rails-0.4/lib/jruby-rack-0.9.jar!/jruby/rack/servlet_helper.rb:34:in
`respond'
from
/Library/Java/libs/jruby-1.1/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/interface.rb:174:in
`__jcreate_proxy!'
from
file:/Library/Java/libs/jruby-1.1/lib/ruby/gems/1.8/gems/jetty-rails-0.4/lib/jruby-rack-0.9.jar!/rack/builder.rb:1
...internal jruby stack elided...
--
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