JRoR: Unitialized constant ActionController::Session::JavaServletStore error on any dynamic request


#1

All,

Mac OS X 10.6

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=’


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

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.

http://github.com/kofno/jruby-rack/tree/master

/Ryan

Wes G. wrote:

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:insessio
n_store=’


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ryan L. Bell


http://twitter.com/kofno
http://github.com/kofno


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

Ryan,

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:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

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

LacKac


#5

On Tue, Feb 24, 2009 at 3:02 PM, László Bácsi removed_email_address@domain.invalid 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.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#6

If that’s an option for you, that would probably be easiest.

/Ryan

Wes G. wrote:

using sessions.

Mac OS X 10.6
Warbler 0.9.12

   from 
   from 

load' from at at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) atconst_missin
http://xircles.codehaus.org/manage_email

Ryan L. Bell


http://twitter.com/kofno
http://github.com/kofno


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#7

+1


Nick S. wrote:
On Tue, Feb 24, 2009 at 3:02 PM, László 
Bácsi <removed_email_address@domain.invalid> 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.

/Nick


To unsubscribe from this list, please visit:

<a class="moz-txt-link-freetext" 

href=“http://xircles.codehaus.org/manage_email”>http://xircles.codehaus.org/manage_email



--

Ryan L. Bell
http://kofno.wordpress.com
http://twitter.com/kofno
http://github.com/kofno


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#8

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:ineach’
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:inbuild’
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:inprepare_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:inrun’
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:inload_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:ininstance_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)

László Bácsi wrote:

situation). You can use this pastie for this: http://pastie.org/399142 Put

/Ryan

java version “1.5.0_16”

SEVERE: Error: application initialization failed
n_store=’
from
`load_environment’
from :3
at
at
at

n_store=’

Ryan L. Bell


View this message in context:
http://www.nabble.com/JRoR%3A-Unitialized-constant-ActionController%3A%3ASession%3A%3AJavaServletStore-error-on-any-dynamic-request-tp22187928p22246253.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email