users@glassfish.java.net

Request env not updated when running rails app with Native jruby deployment

From: <glassfish_at_javadesktop.org>
Date: Fri, 30 Apr 2010 12:48:22 PDT

I'm getting a strange behavior with rails 2.3.5/jruby 1.4.0/rack 1.0.1 and Glassfish v3. The app is displaying the request env variables and with multiple clients hitting, it always returns the same for all requests after the first. If I enable multiple threads, I always get the ENV variables of the 1st client to hit that specific server thread. Anyone else experienced this problem?

If running in webrick it works ok.

This is the controller code:

class TestController < ApplicationController
  def index
    render :text => request.env['REMOTE_HOST']
  end
end

If I access first from machine A, it will display hostnameA for all machines in the network. I have to restart glassfish to make it show something else. If I enable multiple threads in Glassfish, I see it toggling as I hit refresh. It's as if each thread is storing the env variables of the first client to hit.

Is anyone else experiencing this kind of problem? Any suggestions for a workaround or fix?
[Message sent by forum member 'pmma']

http://forums.java.net/jive/thread.jspa?messageID=399818