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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2009-02-24 19:45
(Received via mailing list)
All,

Mac OS X 10.6

JDK:
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_16-b06-284)
Java HotSpot(TM) 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:in
`sessio
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:in
`require_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:in
`run'
        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:in
`load_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:in
`instance_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 <script>: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:in
`sessio
n_store='


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
F34d2984f36c86ecc19b32e7142a7354?d=identicon&s=25 Ryan L. Bell (Guest)
on 2009-02-24 21:24
(Received via mailing list)
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 Gamble 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:in
> `sessio
> n_store='
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    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
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2009-02-24 22:33
(Received via mailing list)
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
F34d2984f36c86ecc19b32e7142a7354?d=identicon&s=25 Ryan L. Bell (Guest)
on 2009-02-24 22:35
(Received via mailing list)
If that's an option for you, that would probably be easiest.

/Ryan

Wes Gamble 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)
>>>        at
>>> `const_missin
>>>    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
D3ab365ec2c78d27e5a68e912848e85f?d=identicon&s=25 László Bácsi (Guest)
on 2009-02-25 00:02
(Received via mailing list)
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
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-25 02:39
(Received via mailing list)
On Tue, Feb 24, 2009 at 3:02 PM, László Bácsi <lackac@gmail.com> 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
F34d2984f36c86ecc19b32e7142a7354?d=identicon&s=25 Ryan L. Bell (Guest)
on 2009-02-25 02:44
(Received via mailing list)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
+1<br>
<br>
<br>
Nick Sieger wrote:
<blockquote
 cite="mid:f0b861390902241738y3e73e342g84b302ec42d1bb9@mail.gmail.com"
 type="cite">
  <pre wrap="">On Tue, Feb 24, 2009 at 3:02 PM, L&aacute;szl&oacute;
B&aacute;csi <a class="moz-txt-link-rfc2396E"
href="mailto:lackac@gmail.com">&lt;lackac@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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://x...


  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--

Ryan L. Bell
<a class="moz-txt-link-freetext"
href="http://kofno.wordpress.com">http://kofno.wordpress...
<a class="moz-txt-link-freetext"
href="http://twitter.com/kofno">http://twitter.com/kofno...
<a class="moz-txt-link-freetext"
href="http://github.com/kofno">http://github.com/kofno</...
</body>
</html>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
D1ca750fb5393d38852dd74ca4c35557?d=identicon&s=25 Behrang Javaherian (Guest)
on 2009-02-27 14:51
(Received via mailing list)
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 <script>: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 <script>:3
>>>>>       at
>>>>>  at
>>>>>       at
>>>>>
>>>>> n_store='
>>>>
>> Ryan L. Bell
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/JRoR%3A-Unitialized-constant...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.