JDK:
java version “1.5.0_16”
Java™ 2 Runtime Environment, Standard Edition (build
1.5.0_16-b06-284)
Java HotSpot™ Client VM (build 1.5.0_16-133, mixed mode, sharing)
Rails 2.3
JRuby 1.1.6
rack 0.9.1
Warbler 0.9.12
Tomcat 6.0.18
I have a fairly straightforward app. that I’ve deployed to Tomcat
6.0.18.
When I make any dynamic request, I get the stack trace below. Why is
JavaServletStore not initialized?
Wes
Feb 24, 2009 12:37:24 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error: application initialization failed
javax.servlet.ServletException:
org.jruby.rack.RackInitializationException: uninitialized constant
ActionController::Session::JavaServletStore
from
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/activesupport-2.3.0/lib/active_support/dependencies.rb:80:in const_missin g_with_dependencies' from /Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/session_management.rb:18:insessio
n_store=’
from
file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:58:in setup_actionpack' from file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:47:inrequire_frameworks_with_se
rvlet_env’
from
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/rails-2.3.0/lib/initializer.rb:134:in process' from /Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/rails-2.3.0/lib/initializer.rb:113:inrun’
from
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/config/environment.rb:18
from
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/config/environment.rb:29:in load' from file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29:inload_environment’
from
file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152:in new' from <script>:3 from file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:ininstance_eval’
from
file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in
`initialize’
from :3
at
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:42)
at
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:38)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:613)
Caused by: org.jruby.rack.RackInitializationException: uninitialized
constant ActionController::Session::JavaServletStore
from
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/activesupport-2.3.0/lib/active_support/dependencies.rb:80:in const_missin g_with_dependencies' from /Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/session_management.rb:18:insessio
n_store=’
jruby-rack is a little broke on rails 2.3 at the moment because rails
went all rack. I have a fork with a work around for the problem, but you
would need to explicitly specify the cookie_store if you are using
sessions.
JRuby 1.1.6
Wes
from
from load' from at at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at /Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/session_management.rb:18:in sessio
n_store=’
Should I just stick with Rails 2.2.2 until this fix gets merged in?
Wes
Ryan L. Bell wrote:
When I make any dynamic request, I get the stack trace below. Why is
/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/gems/gems/activesupport-2.3.0/lib/active_support/dependencies.rb:80:in
file:/Applications/apache-tomcat-6.0.18/webapps/HeatMapDemo/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:47:in
from
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
from
To unsubscribe from this list, please visit:
Setting cookie_store didn’t work for me. jruby-rack initializes
session_store with :java_servlet_store in order to have that as default
if
the developer doesn’t specify something else. This is a problem in Rails
2.3
because rails looks in other places for this class and jruby-rack
doesn’t
support rails edge’s rack based session management yet.
My workaround for this problem was to define this class in the right
place
with a dummy interface and use another session store (memcache in our
situation). You can use this pastie for this: http://pastie.org/399142
Put
this into your environment.rb just before Rails::Initializer.run
On Tue, Feb 24, 2009 at 3:02 PM, László Bácsi [email protected] wrote:
Setting cookie_store didn’t work for me. jruby-rack initializes
session_store with :java_servlet_store in order to have that as default if
the developer doesn’t specify something else. This is a problem in Rails 2.3
because rails looks in other places for this class and jruby-rack doesn’t
support rails edge’s rack based session management yet.
Related: I’m going to trash this behavior for the next jruby-rack
release and just let the Rails default of the cookie store be.
Setting cookie_store didn't work for me. jruby-rack
initializes
session_store with :java_servlet_store in order to have that as default
if
the developer doesn't specify something else. This is a problem in Rails
2.3
because rails looks in other places for this class and jruby-rack
doesn't
support rails edge's rack based session management yet.
Related: I'm going to trash this behavior for the next jruby-rack
release and just let the Rails default of the cookie store be.
I tried the code that you pasted, Now I am getting this error:
org.jruby.rack.RackInitializationException: undefined method new' for "Rack::Head":String from /opt/beyondng/hhtimesheet/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/middleware_stack.rb:106:in each’
from
/opt/beyondng/hhtimesheet/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/middleware_stack.rb:106:in inject' from /opt/beyondng/hhtimesheet/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/middleware_stack.rb:106:in build’
from
/opt/beyondng/hhtimesheet/WEB-INF/gems/gems/actionpack-2.3.0/lib/action_controller/dispatcher.rb:59:in initialize' from /opt/beyondng/hhtimesheet/WEB-INF/gems/gems/rails-2.3.0/lib/initializer.rb:589:in prepare_dispatcher’
from
/opt/beyondng/hhtimesheet/WEB-INF/gems/gems/rails-2.3.0/lib/initializer.rb:176:in process' from /opt/beyondng/hhtimesheet/WEB-INF/gems/gems/rails-2.3.0/lib/initializer.rb:113:in run’
from /opt/beyondng/hhtimesheet/WEB-INF/config/environment.rb:24
from /opt/beyondng/hhtimesheet/WEB-INF/config/environment.rb:29:in load' from file:/opt/beyondng/hhtimesheet/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29:in load_environment’
from
file:/opt/beyondng/hhtimesheet/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152:in new' from <script>:3 from file:/opt/beyondng/hhtimesheet/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in instance_eval’
from
file:/opt/beyondng/hhtimesheet/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in
`initialize’
from :3
at
org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:154)
at
org.jruby.rack.PoolingRackApplicationFactory$1.run(PoolingRackApplicationFactory.java:159)
at java.lang.Thread.run(Thread.java:619)