Hi Buddies,
I am currently working on getting a spree project online by JRuby on
Rails. I am using Spree 0.11, Rails 2.3.8 and JRuby 1.5.3.
I also write quite a couple of extensions to meet our business for
spree and freeze the spree code in my source code at ${project}/vendor/
spree.
And I deployed it in Tomcat 6, it works well without the thread safe
feature.
For JRuby consume huge memory, I wanted to take the advantage of the
thread-safe ability of rails since Rails 2.3.8. So I add
config.threadsafe! in the production.rb and take the site online.
But I will get the following error which would not happen without the
config.threadsafe! line.
It looks like that while the request going directly through the metal
rack code, create_admin_user.rb, it could not find the User::Role.
Is there anything specific I should take care to get this work?
Oct 10, 2010 12:31:21 AM org.apache.catalina.core.ApplicationContext
log
INFO: /!\ FAILSAFE /!\ Sun Oct 10 00:31:21 +0800 2010
Status: 500 Internal Server Error
uninitialized constant User::Role
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activesupport/lib/
active_support/dependencies.rb:105:in const_missing' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/base.rb:1:in
class_eval’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/base.rb:2234:in compute_type' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activesupport/lib/ active_support/core_ext/kernel/reporting.rb:11:in
silence_warnings’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/base.rb:2230:in compute_type' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/reflection.rb:156:in
klass’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:2045:in initialize' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1929:in
new’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:1929:in build_join_association' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1912:in
build’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:1915:in build' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1914:in
each’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:1914:in build' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1835:in
initialize’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:1400:in new' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1400:in
find_with_associations’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/associations.rb:1399:in catch' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/associations.rb:1399:in
find_with_associations’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/base.rb:1576:in find_every' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/base.rb:1535:in
find_initial’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/base.rb:616:in find' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/base.rb:626:in
first’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/spree/app/metal/
create_admin_user.rb:11:in call' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/railties/lib/rails/rack/ metal.rb:44:in
call’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/railties/lib/rails/rack/
metal.rb:43:in each' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/railties/lib/rails/rack/ metal.rb:43:in
call’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/actionpack/lib/
action_controller/session/abstract_store.rb:128:in call' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/query_cache.rb:29:in
call’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/query_cache.rb:34:in
cache' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/query_cache.rb:9:in
cache’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/
active_record/query_cache.rb:28:in call' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/ active_record/connection_adapters/abstract/connection_pool.rb:361:in
call’
/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/vendor/rails/actionpack/lib/
action_controller/failsafe.rb:26:in call' /Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/vendor/rails/actionpack/lib/ action_controller/dispatcher.rb:106:in
call’
file:/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.1.jar!/rack/adapter/
rails.rb:36:in serve_rails' file:/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.1.jar!/rack/adapter/ rails.rb:41:in
call’
file:/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/
tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.1.jar!/jruby/rack/
rails.rb:180:in call' file:/Users/stanley/Documents/codebase/imoso_code/lianyijia_tomcat/ tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.1.jar!/rack/handler/ servlet.rb:19:in
call’
:1
Best wishes,
Stanley Xu