I have a large rails application that has been successfully converted to use JRuby and it runs locally without any problems bundle exec rails s -b 0.0.0.0 .
Now I am trying to create a deployable WAR file using the following:
bundle exec warble executable war
This succeeds without error, but when started with:
java -jar application.war
It loads, and then after a few seconds it spits out this error:
2016-06-28 11:48:16.544:INFO::main: Logging initialized @228ms 2016-06-28 11:48:16.553:INFO:oejr.Runner:main: Runner 2016-06-28 11:48:16.698:INFO:oejs.Server:main: jetty-9.2.9.v20150224 2016-06-28 11:48:32.680:WARN:oeja.AnnotationConfiguration:main: ServletContainerInitializers: detected. Class hierarchy: empty 2016-06-28 11:48:33.692:INFO:/:main: INFO: jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64] 2016-06-28 11:48:33.694:INFO:/:main: INFO: using a shared (threadsafe!) runtime org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- bundler/dep_proxy at RUBY.block in expand_dependencies(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:630) at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1593) at RUBY.block in expand_dependencies(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:629) at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1593) at RUBY.expand_dependencies(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:626) at RUBY.converge_locked_specs(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:594) at RUBY.resolve(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:195) at RUBY.specs(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:140) at RUBY.specs_for(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:185) at RUBY.requested_specs(uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:174) at RUBY.requested_specs(uri:classloader:/gems/bundler-1.12.5/lib/bundler/environment.rb:19) at RUBY.setup(uri:classloader:/gems/bundler-1.12.5/lib/bundler/runtime.rb:14) at RUBY.setup(uri:classloader:/gems/bundler-1.12.5/lib/bundler.rb:95) at RUBY.<top>(uri:classloader:/gems/bundler-1.12.5/lib/bundler/setup.rb:9) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:944) at RUBY.(root)(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1) at RUBY.<top>(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:133) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:944) at RUBY.(root)(/private/var/folders/9v/9b6v35h55nl94trls0l52h4c0000gn/T/jetty-0.0.0.0-8080-application.war-_-any-4553071680754868493.dir/webapp/WEB-INF/config/boot.rb:3) at RUBY.(root)(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1) at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) at RUBY.<top>(uri:classloader:/jruby/rack/rails/environment3.rb:23)
It gets stuck, unable to download bundler / dep_proxy, and Google does not lead to the search for similar problems. I changed the warbler configuration file, but the result was the same problem.
Ruby JRuby was installed with rbenv .
Stack Information:
$ jruby -v jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64] $ bundle env Environment Bundler 1.12.5 Rubygems 2.6.4 Ruby 2.3.0p0 (2016-05-26 revision 52539) [java] Git 2.9.0 Gemfile source 'https://rubygems.org' ruby '2.3.0', :engine => 'jruby', :engine_version => '9.1.2.0' gem 'rails', '4.2.6' gem 'sass-rails', '~> 5.0' gem 'bourbon' gem 'font-awesome-sass' gem 'uglifier', '>= 1.3.0' gem 'jquery-rails' gem 'jquery-turbolinks' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'country_select' gem 'devise', '3.5.3' gem 'devise-i18n-views' gem 'devise-encryptable' gem 'devise_security_extension' gem 'cancancan' gem 'rolify' gem 'carrierwave' gem 'carrierwave-bombshelter' gem 'mini_magick' gem 'file_validators', '2.0.2' gem 'gretel' gem 'font-awesome-rails' gem 'kaminari' gem 'pg_search' gem 'responders' gem 'date_validator' gem 'validates_timeliness', '~> 4.0' gem 'roo', '~> 2.3.2' gem 'lipsum', :require => false gem 'faker', :require => false gem 'pushmeup', :require => false gem 'rack-attack' gem 'barby', :require => false gem 'prawn', :require => false gem 'rest-client', :require => false gem 'geokit', :require => false gem 'text', :require => false gem 'savon', :require => false gem 'plugg' gem 'postmark-rails', '~> 0.12.0' gem 'breadcrumbs_on_rails' platforms :ruby do gem 'pg' gem 'therubyracer' end platforms :jruby do gem 'jruby-jars' gem 'jruby-openssl' gem 'jruby-rack' gem 'activerecord-jdbcpostgresql-adapter' gem 'puma' gem 'therubyrhino' group :development, :test do gem 'warbler' end end group :development, :test do
Warble configuration file:
Warbler::Config.new do |config| config.webxml.rails.env = 'development' config.features = %w(gemjar executable) config.dirs = %w(app config db lib log vendor tmp modules public) config.includes = FileList['Rakefile', 'lib/tasks/generate_ident.rake'] config.excludes = FileList["test/*"] config.bundle_without = ["development", "test", "assets", "doc"] config.jar_name = "application" end
The Warbler configuration extension I used:
Warbler::Config.new do |config| config.features = %w(gemjar compiled executable) config.dirs = %w(app config db lib log vendor tmp modules public) config.includes = FileList['Rakefile', 'lib/tasks/generate_ident.rake'] config.excludes = FileList["test/*", '.DS_Store'] config.java_libs += FileList["lib/*.jar"] config.bundler = true config.bundle_without = ["development", "test", "assets", "doc"] config.gem_dependencies = true config.gem_excludes = [/^(test|spec)\//, /_test.rb/, /rails_generator/] config.jar_name = "application" config.compiled_ruby_files = FileList['app/**/*.rb', 'config/*.rb', 'config/**/*.rb', 'lib/*.rb', 'lib/**/*.rb', 'modules/*.rb', 'modules/**/*.rb'] config.override_gem_home = true config.move_jars_to_webinf_lib = true config.webxml.rails.env = ENV['RAILS_ENV'] || 'development' config.webxml.jruby.min.runtimes = 2 config.webxml.jruby.max.runtimes = 8 end
Is there a configuration or something else that I am missing?
Update:
Running a standalone WAR in Tomcat (7) spits out the same error and additional information:
--- System jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [linux-x86_64] Time: 2016-06-30 10:06:49 +0000 Server: Apache Tomcat/7.0.52 (Ubuntu) jruby.home: uri:classloader://META-INF/jruby.home --- Context Init Parameters: jruby.max.runtimes = 8 jruby.min.runtimes = 2 public.root = / rails.env = development --- Backtrace LoadError: no such file to load -- bundler/dep_proxy block in expand_dependencies at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:630 each at org/jruby/RubyArray.java:1593 block in expand_dependencies at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:629 each at org/jruby/RubyArray.java:1593 expand_dependencies at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:626 converge_locked_specs at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:594 resolve at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:195 specs at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:140 specs_for at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:185 requested_specs at uri:classloader:/gems/bundler-1.12.5/lib/bundler/definition.rb:174 requested_specs at uri:classloader:/gems/bundler-1.12.5/lib/bundler/environment.rb:19 setup at uri:classloader:/gems/bundler-1.12.5/lib/bundler/runtime.rb:14 setup at uri:classloader:/gems/bundler-1.12.5/lib/bundler.rb:95 <top> at uri:classloader:/gems/bundler-1.12.5/lib/bundler/setup.rb:19 require at org/jruby/RubyKernel.java:944 (root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1 <top> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:133 load at org/jruby/RubyKernel.java:962 <top> at /var/lib/tomcat7/webapps/application/WEB-INF/config/boot.class:3 require at org/jruby/RubyKernel.java:944 (root) at /var/lib/tomcat7/webapps/application/WEB-INF/config/boot.rb:1 (root) at /var/lib/tomcat7/webapps/application/WEB-INF/config/boot.rb:1 (root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1 <top> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55 --- RubyGems Gem.dir: /var/lib/tomcat7/webapps/application/WEB-INF/gems Gem.path: /usr/share/tomcat7/.gem/jruby/2.3.0 uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared /var/lib/tomcat7/webapps/application/WEB-INF/gems Activated gems: bundler-1.12.5 --- Bundler Bundler.bundle_path: /var/lib/tomcat7/webapps/application/WEB-INF/gems Bundler.root: /var/lib/tomcat7/webapps/application/WEB-INF Gemfile: /var/lib/tomcat7/webapps/application/WEB-INF/Gemfile Settings: gemfile = /var/lib/tomcat7/webapps/application/WEB-INF/Gemfile without = development:test:assets:doc orig_path = /bin:/usr/bin:/sbin:/usr/sbin --- JRuby-Rack Config compat_version = default_logger = org.jruby.rack.logging.StandardOutLogger@5b18447d equals = <error: > err = org.apache.tomcat.util.log.SystemLogHandler@d610b4f filter_adds_html = true filter_verifies_resource = false ignore_environment = false initial_memory_buffer_size = initial_runtimes = 2 jms_connection_factory = jms_jndi_properties = logger = org.jruby.rack.logging.ServletContextLogger@5be8fe29 logger_class_name = servlet_context logger_name = jruby.rack maximum_memory_buffer_size = maximum_runtimes = 8 num_initializer_threads = out = org.apache.tomcat.util.log.SystemLogHandler@3b4aedd8 rackup = rackup_path = rewindable = true runtime_arguments = runtime_environment = runtime_timeout_seconds = serial_initialization = false servlet_context = org.apache.catalina.core.ApplicationContextFacade@1097ea05 throw_init_exception = false --- $LOAD_PATH: uri:classloader:/META-INF/jruby.home/lib/ruby/2.3/site_ruby uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib
Update 2:
I tried every version of bundler from the latest up to 1.10 with exactly the same result.
I also downgraded JRuby to 1.7.25, the same.