Hello all:
I have been trying to package a working RoR app into a WAR file and
deploy it to Jboss. By using Warble I am able to create the WAR file
successfully, but, when it gets deployed to JBoss 5, the app fails to
start. This is the exception that I am getting in the log file:
org.jruby.rack.RackInitializationException: undefined method new' for "Rack::Head":String from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
each’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
inject' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
build’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
build_middleware_stack' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:81:in
initialize’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:in
run_prepare_callbacks' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:631:in
prepare_dispatcher’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:185:in
process' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:113:in
run’
from
/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:20
from
/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:29:in
load' from /home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:29:in
load_environment’
from
/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:152:in
new' from <script>:3 from /home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22:in
instance_eval’
from
/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/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)
Caused by: org.jruby.exceptions.RaiseException
at
Kernel.method_missing(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:72)
at
ActionController::MiddlewareStack::Middleware.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
ActionController::MiddlewareStack.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
Array.each(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
Enumerable.inject(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
ActionController::MiddlewareStack.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130)
at
ActionController::Dispatcher.build_middleware_stack(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:81)
at
ActionController::Dispatcher.initialize(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51)
at
#Class:01x6928de56.run_prepare_callbacks(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:631)
at
Rails::Initializer.prepare_dispatcher(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:185)
at
Rails::Initializer.process(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:113)
at
#Class:01x47d9fe05.run(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:20)
at
(unknown).(unknown)(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:29)
at
Kernel.load(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:29)
at
JRuby::Rack::RailsServletHelper.load_environment(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:152)
at #Class:01x989727e.new(:3)
at
(unknown).(unknown)(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at
Kernel.instance_eval(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at
Kernel.instance_eval(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at Rack::Builder.initialize(:3)
at (unknown).(unknown)(:1)
2010-05-12 07:06:06,193 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]]
(JRuby-Rack-App-Init-0) Error: unable to initialize application
org.jruby.rack.RackInitializationException: undefined method new' for "Rack::Head":String from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
each’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
inject' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in
build’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
build_middleware_stack' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:81:in
initialize’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:in
run_prepare_callbacks' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:631:in
prepare_dispatcher’
from
/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:185:in
process' from /home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:113:in
run’
from
/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:20
from
/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:29:in
load' from /home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:29:in
load_environment’
from
/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:152:in
new' from <script>:3 from /home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22:in
instance_eval’
from
/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/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)
Caused by: org.jruby.exceptions.RaiseException
at
Kernel.method_missing(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:72)
at
ActionController::MiddlewareStack::Middleware.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
ActionController::MiddlewareStack.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
Array.each(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
Enumerable.inject(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116)
at
ActionController::MiddlewareStack.build(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130)
at
ActionController::Dispatcher.build_middleware_stack(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:81)
at
ActionController::Dispatcher.initialize(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51)
at
#Class:01x7a1d1609.run_prepare_callbacks(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:631)
at
Rails::Initializer.prepare_dispatcher(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:185)
at
Rails::Initializer.process(/home/jboss-5.0.0.CR2/server/portal/tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:113)
at
#Class:01x4d09f1ae.run(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:20)
at
(unknown).(unknown)(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:29)
at
Kernel.load(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:29)
at
JRuby::Rack::RailsServletHelper.load_environment(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:152)
at #Class:01x3cd2c241.new(:3)
at
(unknown).(unknown)(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at
Kernel.instance_eval(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at
Kernel.instance_eval(/home/jboss-5.0.0.CR2/server/portal/deploy/portal.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/builder.rb:22)
at Rack::Builder.initialize(:3)
at (unknown).(unknown)(:1)
What is interesting, is that it always references this from my app:
at
#Class:01x47d9fe05.run(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:20)
at
(unknown).(unknown)(/home/jboss-5.0.0.CR2/server/portal/./tmp/deploy/portal4350990379049296769-exp.war/WEB-INF/config/environment.rb:29)
and even though I have tried to change the config file, it always
complains about line 29, regardless of what line 29 maybe. Sometimes
line 29 was blank, once it was a comment.
Here’s my config.rb:
Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = ‘2.3.5’ unless defined? RAILS_GEM_VERSION
Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(FILE), ‘boot’)
Use database sessions
if RUBY_PLATFORM =~ /java/
hack to fix jruby-rack’s incompatibility with rails edge
module ActionController
module Session
class JavaServletStore
def initialize(app, options={}); end
def call(env); end
end
end
end
end
Rails::Initializer.run do |config|
#config.gem ‘rubycas-client’, :lib => “casclient”
#config.gem ‘rubycas-client’, :lib =>
“casclient/frameworks/rails/filter”
if RUBY_PLATFORM =~ /java/
config.plugins = [:all]
config.plugins-= [:rails_development_boost,:‘rails-dev-boost’]
end
config.time_zone = ‘UTC’
config.action_controller.session = {
:session_key => ‘_portal_session’,
:secret => ‘REPLACE_ME_WITH_A_REAL_SECRET’
}
end
enable detailed CAS logging for easier troubleshooting
#cas_logger = CASClient::Logger.new(RAILS_ROOT+‘/log/cas.log’)
#cas_logger.level = Logger::DEBUG
#EMAIL_WEBSERVICE_URL=“http://67.207.148.113:8080/emailservice/emails”
#CASClient::Frameworks::Rails::Filter.configure(
:cas_base_url => “https://barquindev-jruby:8643/cas”,
:proxy_retrieval_url =>
“https://barquindev-jruby::444/portal_proxy_server/cas_proxy_callback/retrieve_pgt”,
:proxy_callback_url =>
“https://barquindev-jruby::444/portal_proxy_server/cas_proxy_callback/receive_pgt”,
:logger => cas_logger
#)
FIXME: regenerate keys and keep them secret this time
#ENV[‘RECAPTCHA_PUBLIC_KEY’] =
‘6LeH1wkBBBBBBKM-WMeSXGLOq9iSjia0vG6iPdnR’
#ENV[‘RECAPTCHA_PRIVATE_KEY’] =
‘6LeH1wkBBBBBBGdgKAPYZ1G7oVnzC8GFsVf5RDGt’
Has anyone come across this before? Any help would be greatly
appreciated.