This project is archived and is in readonly mode.

#5591 ✓invalid
Robert Glaser

Can't boot Rails 3.0 app on JRuby/Windows/Tomcat due to EncodingException

Reported by Robert Glaser | September 9th, 2010 @ 04:40 PM

When I try to boot a Rails 3.0 app on a Windows Server 2008 with JRuby 1.5.2 and Tomcat, I get the following exception within ActiveSupport:

Sep 9, 2010 3:39:24 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Application Error
org.jruby.rack.RackInitializationException: No such file to load -- org.jcodings.exception.EncodingException: invalid code point value
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:216:in `require_dependency'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:138:in `eager_load!'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:137:in `each'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:137:in `eager_load!'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:135:in `each'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:135:in `eager_load!'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application.rb:108:in `eager_load!'
    from C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application/finisher.rb:41
     ... 19 levels...
    from classpath:/vendor/rack-1.2.1/rack/builder.rb:46:in `initialize'
    from <script>:2:in `new'
    from <script>:2

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:184)
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:59)
    at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:94)
    at org.jruby.rack.servlet.DefaultServletDispatcher.process(DefaultServletDispatcher.java:36)
    at org.jruby.rack.RackFilter.doFilter(RackFilter.java:59)
    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:128)
    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:293)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.jruby.exceptions.RaiseException: No such file to load -- org.jcodings.exception.EncodingException: invalid code point value
    at Kernel.raise(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:304)
    at ActiveSupport::Dependencies.depend_on(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:216)
    at ActiveSupport::Dependencies::Loadable.require_dependency(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:138)
    at Rails::Engine.eager_load!(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:137)
    at Array.each(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:137)
    at Rails::Engine.eager_load!(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:135)
    at Array.each(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/engine.rb:135)
    at Rails::Engine.eager_load!(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application.rb:108)
    at Rails::Application.eager_load!(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application/finisher.rb:41)
    at (unknown).(unknown)(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:25)
    at Kernel.instance_exec(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:25)
    at Kernel.instance_exec(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:25)
    at Rails::Initializable::Initializer.run(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:50)
    at Rails::Initializable.run_initializers(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:49)
    at Array.each(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/initializable.rb:49)
    at Rails::Initializable.run_initializers(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application.rb:134)
    at Rails::Application.initialize!(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application.rb:77)
    at #<Class:01xc5752e>.method_missing(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/config/environment.rb:5)
    at (unknown).(unknown)(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/config/environment.rb:239)
    at Kernel.require(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239)
    at ActiveSupport::Dependencies::Loadable.require(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225)
    at ActiveSupport::Dependencies::Loadable.load_dependency(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591)
    at ActiveSupport::Dependencies.new_constants_in(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225)
    at ActiveSupport::Dependencies::Loadable.load_dependency(C:/Program Files/Apache Software Foundation/Tomcat 6.0/temp/0-ROOT/WEB-INF/gems/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239)
    at ActiveSupport::Dependencies::Loadable.require(classpath:/jruby/rack/rails.rb:161)
    at JRuby::Rack::RailsBooter::Rails3Environment.load_environment(classpath:/jruby/rack/rails.rb:165)
    at JRuby::Rack::RailsBooter::Rails3Environment.to_app(classpath:/jruby/rack/rails.rb:186)
    at #<Class:01x893021>.new(<script>:2)
    at (unknown).(unknown)(classpath:/vendor/rack-1.2.1/rack/builder.rb:46)
    at Kernel.instance_eval(classpath:/vendor/rack-1.2.1/rack/builder.rb:46)
    at Kernel.instance_eval(classpath:/vendor/rack-1.2.1/rack/builder.rb:46)
    at Rack::Builder.initialize(<script>:2)
    at (unknown).new(<script>:2)
    at (unknown).(unknown)(:1)

I attached the complete stack trace. It seems that JRuby wraps a try/catch around the boot process and throws a RackInitializationException on any exception. I looked into dependencies.rb, but found no obvious bad encodings.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages