RackInitializationException when deploying to Tomcat

I have just tried to update a live project, and I get this error in the
log:

SEVERE: Exception caught
org.jruby.rack.RackInitializationException: undefined method
`add_builtin_type’ for YAML:Module

Going back to the previous version, that still works fine. The new
project passes hundreds of tests, and works fine on Webrick too.

I am using Tomcat 6, JRuby 1.5.0, Warbler 1.1 on Windows. Besides
changes in the code, I have also changed from Rails 2.2.2 to 2.3.8, and
I suspected this is the problem, so as a test, I created a new project,
“tester”, with a single model, two columns as build be generate
scaffold. That works okay (once I realised Tomcat had to be in a folder
with no spaces in the path).

I do not use the method “add_builtin_type” anywhere in my project. My
database.yml file in my project is identical to the one in the test,
except the database names, so it is not an issue trying to read that.

I have also tried the changes described here:
http://kenai.com/projects/jruby/pages/Rails_2_3_2, to handle sessions,
but no effect.

I am a bit lost as to what to do now. Any suggestions welcome…

Andy


Full error:

SEVERE: Exception caught
org.jruby.rack.RackInitializationException: undefined method
add_builtin_type' for YAML:Module from file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require’
from
C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb:1
from
C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb:31:in
require' from file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require’
from
C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8
from
C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8:in
each' from C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8 from C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:31:in require’
… 18 levels…
from
file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:in
instance_eval' from file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29:in initialize’
from :2

at
org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:153)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:50)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:95)
at
org.jruby.rack.servlet.DefaultServletDispatcher.process(DefaultServletDispatcher.java:32)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:53)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException: undefined method
`add_builtin_type’ for YAML:Module
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/ordered_hash.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb:1)
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8)
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8)
at
Array.each(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:8)
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support.rb:56)
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record.rb:25)
at
(unknown).(unknown)(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:268)
at
Rails::Initializer.require_frameworks(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:268)
at
Array.each(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:268)
at
Rails::Initializer.require_frameworks(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/jruby/rack/rails.rb:43)
at
Rails::Initializer.require_frameworks_with_servlet_env(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:134)
at
Rails::Initializer.process(C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:113)
at
#Class:01x659078.run(C:\apache-tomcat-6.0.26\webapps\f2db\WEB-INF/config/environment.rb:18)
at
(unknown).(unknown)(C:\apache-tomcat-6.0.26\webapps\f2db\WEB-INF/config/environment.rb:26)
at
Kernel.load(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/jruby/rack/rails.rb:26)
at
JRuby::Rack::RailsServletHelper.load_environment(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/jruby/rack/rails.rb:151)
at #Class:01x13dcf55.new(:2)
at
(unknown).(unknown)(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at
Kernel.instance_eval(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/builder.rb:29)
at Rack::Builder.initialize(:2)
at (unknown).(unknown)(:1)

Hi Andy,

Actually I think you are not using JRuby 1.5.0 because of your
stacktrace:

file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!

Please verify your setup, I remember the yaml parser changed a lot from
1.3.0RC2 to 1.5

Cheers

I agree with David…

looks like you are using jruby-complete-1.3.0RC2.jar

do you have warbler vendored into your application and you run rake
warble instead of warble war? if so … that could be the issue…

The other thing to think about is updating your version of jruby-rack
to the latest.

On Wed, Jun 9, 2010 at 11:10 AM, Andy J. [email protected] wrote:

I am using Tomcat 6, JRuby 1.5.0, Warbler 1.1 on Windows. Besides
I have also tried the changes described here:

`require’
from

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
Caused by: org.jruby.exceptions.RaiseException: undefined method
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
at

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

David C. wrote:

Hi Andy,

Actually I think you are not using JRuby 1.5.0 because of your
stacktrace:

file:/C:/apache-tomcat-6.0.26/webapps/f2db/WEB-INF/lib/jruby-complete-1.3.0RC2.jar!

Please verify your setup, I remember the yaml parser changed a lot from
1.3.0RC2 to 1.5

Cheers

Ah, you are correct. I thought I had removed earlier versions to make
sure it was using the right one, not realising there was a jruby.jar
(and a rack one too) inside the lib directory (which I probably put
there myself a long time ago).

Thanks for the help; it is working fine now.