From 5fb62e3c0234c6dee4f81a644f08c66d00936ec5 Mon Sep 17 00:00:00 2001 From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:13:48 +0800 Subject: [PATCH 1/5] build: fix tests for newer jruby-rack --- Mavenfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mavenfile b/Mavenfile index 2cb2b530..5387a960 100644 --- a/Mavenfile +++ b/Mavenfile @@ -11,6 +11,7 @@ properties( 'mavengem.wagon.version' => '2.0.3', 'jruby.plugins.version' => '3.0.6', 'jetty.version' => '9.4.58.v20250814', + 'jruby-rack.version' => '[1.2,1.2.99999)', ) # dependencies needed for compilation @@ -29,6 +30,7 @@ plugin :install, '3.1.4' gem 'bundler', '${bundler.version}' gem 'jruby-jars', '${jruby.version}' +gem 'jruby-rack', '${jruby-rack.version}' plugin :invoker, '3.10.1' do execute_goals( :install, :run, @@ -39,6 +41,7 @@ plugin :invoker, '3.10.1' do 'jetty.version' => '${jetty.version}', 'bundler.version' => '${bundler.version}', 'jruby.plugins.version' => '${jruby.plugins.version}', + 'jruby-rack.version' => '${jruby-rack.version}', 'style.color' => 'always', }, :goals => ['verify'], From de23f0639bbf844c167f02f332cd502f172de5c4 Mon Sep 17 00:00:00 2001 From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:50:30 +0800 Subject: [PATCH 2/5] test: run tests across jruby-rack versions --- .github/workflows/ci.yml | 16 ++++++++++++++-- Mavenfile | 4 ++-- Rakefile | 1 + integration/pom.xml | 15 +++++++++++---- .../src/main/ruby/config/warble.rb | 1 + 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0df1a1a..3d47ce17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,18 +12,30 @@ on: jobs: ci: + name: ${{ matrix.task }} ${{ matrix.ruby-version }} / java@${{ matrix.java-version }} / jruby-rack@${{ matrix.jruby-rack-version }} runs-on: ubuntu-latest strategy: matrix: + task: ['', integration] java-version: [8, 21, 25] ruby-version: [jruby-9.4, jruby-10.0, jruby-10.1] - task: ['', integration] + jruby-rack-version: ['1.2', '1.3', '2.0'] exclude: - ruby-version: jruby-10.0 # JRuby 10 requires Java 21 minimum java-version: 8 - ruby-version: jruby-10.1 # JRuby 10 requires Java 21 minimum java-version: 8 + - jruby-rack-version: '1.3' # No need to vary jruby-rack version for non-integration + task: '' + - jruby-rack-version: '2.0' # No need to vary jruby-rack version for non-integration + task: '' + - jruby-rack-version: '2.0' # Integration tests not yet compatible with JRuby-Rack 2.0 (jakarta.servlet-api) + task: 'integration' + - jruby-rack-version: '1.3' # JRuby-Rack 1.3+ requires JRuby 10 + ruby-version: jruby-9.4 + - jruby-rack-version: '2.0' # JRuby-Rack 1.3+ requires JRuby 10 + ruby-version: jruby-9.4 fail-fast: false @@ -54,4 +66,4 @@ jobs: run: BUNDLE_JOBS=1 bundle install - name: Run tests - run: bundle exec rake ${{ matrix.task }} + run: bundle exec rake ${{ matrix.task }} "JRUBY_RACK_VERSION='[${{ matrix.jruby-rack-version }},${{ matrix.jruby-rack-version }}.99999)'" diff --git a/Mavenfile b/Mavenfile index 5387a960..a3f4b8a5 100644 --- a/Mavenfile +++ b/Mavenfile @@ -36,12 +36,12 @@ plugin :invoker, '3.10.1' do execute_goals( :install, :run, :id => 'integration-test', :properties => { + 'jruby.plugins.version' => '${jruby.plugins.version}', 'warbler.version' => '${project.version}', 'jruby.version' => '${jruby.version}', - 'jetty.version' => '${jetty.version}', 'bundler.version' => '${bundler.version}', - 'jruby.plugins.version' => '${jruby.plugins.version}', 'jruby-rack.version' => '${jruby-rack.version}', + 'jetty.version' => '${jetty.version}', 'style.color' => 'always', }, :goals => ['verify'], diff --git a/Rakefile b/Rakefile index 5633eea3..a74e1b19 100644 --- a/Rakefile +++ b/Rakefile @@ -25,6 +25,7 @@ task :default => :spec require 'maven/ruby/maven' mvn = Maven::Ruby::Maven.new mvn << "-Djruby.version=#{JRUBY_VERSION}" +mvn << "-Djruby-rack.version=#{ENV['JRUBY_RACK_VERSION'] || ''}" mvn << "-Dbundler.version=#{Bundler::VERSION}" mvn << '--no-transfer-progress' mvn << '--color=always' diff --git a/integration/pom.xml b/integration/pom.xml index 7d494dc9..b3cb6688 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -17,6 +17,7 @@ 2.1.3.pre 9.4.15.0 2.6.3 + [1.2,1.2.99999) 9.4.58.v20250814 @@ -30,14 +31,14 @@ rubygems - bundler - ${bundler.version} + warbler + ${warbler.version} gem rubygems - warbler - ${warbler.version} + bundler + ${bundler.version} gem @@ -46,6 +47,12 @@ ${jruby.version} gem + + rubygems + jruby-rack + ${jruby-rack.version} + gem + org.junit.jupiter junit-jupiter diff --git a/integration/simple_rack_test/src/main/ruby/config/warble.rb b/integration/simple_rack_test/src/main/ruby/config/warble.rb index 09315124..ea2e7fc8 100644 --- a/integration/simple_rack_test/src/main/ruby/config/warble.rb +++ b/integration/simple_rack_test/src/main/ruby/config/warble.rb @@ -2,4 +2,5 @@ config.autodeploy_dir = "../../../target" config.jar_name = "simple_rack_test-1.0" config.bundler = false + config.gems << Gem::Dependency.new("rack", "~> 2.2.0") end From bc36b7e93dd750c8c8a9645a19d92e6a8e307322 Mon Sep 17 00:00:00 2001 From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Date: Tue, 1 Sep 2026 16:32:32 +0800 Subject: [PATCH 3/5] chore: clarify jruby-rack 1.3/2.0 requirements --- README.rdoc | 54 +++++++++++++++++++++++++++++------------------------ Rakefile | 2 +- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/README.rdoc b/README.rdoc index d4f68ef6..dec58910 100644 --- a/README.rdoc +++ b/README.rdoc @@ -12,14 +12,11 @@ Ruby applications to assemble and Just Work. Warbler Status JRuby Java JRuby-Rack Rails Notes ------- ---------- ---------- ---- ---------- --------- ---------------------------------------------- - 2.1 Maintained 9.4 → 10.1 8+ 1.2 → 1.3 5.0 → 8.0 Rails 8.1 may be OK with pure Ruby webservers. + 2.1 Maintained 9.4 → 10.1 8+ 1.2 → 2.0 5.0 → 8.0 Rails 8.1 may be OK with pure Ruby webservers. 2.0 EOL 9.2 → 9.3 6+ 1.1 → 1.2 → 6.1 1.4 EOL 1.1 → 1.7 5+ ? ? -For running wars with specific Java web servers, consult jruby-rack compatibility ( -{master}[https://github.com/jruby/jruby-rack/tree/master], -{1.2-stable}[https://github.com/jruby/jruby-rack/tree/1.2-stable], -{1.1-stable}[https://github.com/jruby/jruby-rack/tree/1.1-stable] ). +For running wars with specific Java web servers, consult {jruby-rack compatibility}[https://github.com/jruby/jruby-rack#compatibility]. == Getting Started @@ -256,10 +253,33 @@ task to give you more insight into what's going on. If you think you found a bug, please file one at https://github.com/jruby/warbler/issues. -=== Common issues with executable wars +=== Common issues with wars If your app isn't working or starting up correctly: +- Jruby-Rack version not compatible with JRuby version + jruby-rack-2.0.0 requires Ruby version >= 3.4.0. The current ruby version is 3.1.7. + jruby-rack-1.3.0 requires Ruby version >= 3.4.0. The current ruby version is 3.1.7. + Warbler is compatible with multiple JRuby-Rack versions which have different JRuby requirements. You are trying to use + a jruby-rack version which does not support your JRuby version; without using bundler to resolve dependencies. + - Consult {jruby-rack compatibility}[https://github.com/jruby/jruby-rack#compatibility] for intended target jruby-rack version + - Use a bundler `:development` group to install warbler, and ensure bundler is running with your intended runtime + JRuby version so the jruby-rack dependency is resolved correctly. + +- Rack version compatibility + An exception happened during JRuby-Rack startup + no such file to load -- rack/chunked + You are trying to use Rack 3.x with a jruby-rack version that does not yet support Rack 3. Try upgrading to a compatible + jruby-rack version, or lock rack at a compatibile version with gem 'rack', '~> 2.2.0'. Note that Rack `2.2` requires Rails < `8.1`. + +- Rack missing at runtime + org.jruby.exceptions.LoadError: (LoadError) cannot load such file -- rack + JRuby-Rack no longer vendors Rack - make sure the rack gem is available to the application (e.g. add it to the Gemfile or install it into the gem path) + You are trying to use JRuby-Rack 1.3+, without a bundle or gem path that resolves an appropriate Rack version via the + `jruby-rack` gem's runtime dependency. Try one of (with appropriate rack version): + - Bundler: add gem 'rack', '~> 2.2.0' or similar as a default/runtime dependency to your `Gemfile` + - Rubygems: add config.gems['rack'] = '~> 2.2.0' to your `config/warble.rb` + - CompatVersion errors: If you are getting java.lang.NoClassDefFoundError: org/jruby/CompatVersion errors at start-up you are probably running Warbler with a jruby-rack version which does not yet support JRuby 10+ - it @@ -270,25 +290,11 @@ If your app isn't working or starting up correctly: that probably means bundler is trying to switch versions dynamically during start-up because your `Gemfile.lock` implies a different locked version of bundler to that packaged with JRuby by default. - JRuby/Bundler running embedded inside a jar like this does not support switching bundler versions dynamically. + JRuby/Bundler running embedded inside a jar like this does not support switching bundler versions dynamically + - Ensure you're on warbler `2.1.2+` and/or jruby-rack `1.2.8+` which attempts to workaround this issue + - If that doesn't help, ensure you are using `BUNDLE_VERSION=system` when bundling/warbling your application to ensure + the identical embedded JRuby bundler version is used during warbling and runtime. - This may happen due to - - system gems for jruby installation upgradingg bundler to a newer version than packaged by default - - running bundle update --bundler - - using `BUNDLE_VERSION` to override bundle version which generating/editing your `Gemfile.lock` - - Options to address this - - use bundle config set version system / bundle config set disable_shared_gems to avoid bundler picking system versions - - ensure your `Gemfile.lock`'s BUNDLED WITH version matches the default bundler packaged with your `jruby-jars` version. - You can check inside the relevant `jruby-stdlib` jar or inside a clean installation dir from your Ruby version manager of choice. - - remove BUNDLED WITH entirely from `Gemfile.lock`. Sometimes bundler will add this back again; so not recommended in the longer term - -- Rack version compatibility - An exception happened during JRuby-Rack startup - no such file to load -- rack/chunked - You are trying to use Rack 3.x with a jruby-rack version that does not yet support Rack 3. Try upgrading to a compatible - jruby-rack version, or lock rack at a compatibile version with gem 'rack', '~> 2.2.0'. Note that Rack `2.2` requires Rails < `8.1`. - == Source You can get the Warbler source using Git, in any of the following ways: diff --git a/Rakefile b/Rakefile index a74e1b19..1ed0c5d3 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,7 @@ task :default => :spec require 'maven/ruby/maven' mvn = Maven::Ruby::Maven.new mvn << "-Djruby.version=#{JRUBY_VERSION}" -mvn << "-Djruby-rack.version=#{ENV['JRUBY_RACK_VERSION'] || ''}" +mvn << "-Djruby-rack.version=#{ENV['JRUBY_RACK_VERSION']}" if ENV['JRUBY_RACK_VERSION'] mvn << "-Dbundler.version=#{Bundler::VERSION}" mvn << '--no-transfer-progress' mvn << '--color=always' From 18010637cdc27e5a890e8181bd3694173b0cbc81 Mon Sep 17 00:00:00 2001 From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Date: Tue, 1 Sep 2026 16:51:53 +0800 Subject: [PATCH 4/5] test: run jruby-rack 2.0 tests via later jetty --- .github/workflows/ci.yml | 10 +++++++--- Mavenfile | 4 +--- Rakefile | 6 +++++- integration/pom.xml | 14 ++++---------- integration/rails7_test/pom.xml | 4 ++-- integration/simple_rack_test/pom.xml | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d47ce17..a4cbdac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: task: ['', integration] - java-version: [8, 21, 25] + java-version: [8, 17, 21, 25] ruby-version: [jruby-9.4, jruby-10.0, jruby-10.1] jruby-rack-version: ['1.2', '1.3', '2.0'] exclude: @@ -26,12 +26,16 @@ jobs: java-version: 8 - ruby-version: jruby-10.1 # JRuby 10 requires Java 21 minimum java-version: 8 + - ruby-version: jruby-10.0 # JRuby 10 requires Java 21 minimum + java-version: 17 + - ruby-version: jruby-10.1 # JRuby 10 requires Java 21 minimum + java-version: 17 + - task: 'integration' # War integration tests require Java 17 + java-version: 8 - jruby-rack-version: '1.3' # No need to vary jruby-rack version for non-integration task: '' - jruby-rack-version: '2.0' # No need to vary jruby-rack version for non-integration task: '' - - jruby-rack-version: '2.0' # Integration tests not yet compatible with JRuby-Rack 2.0 (jakarta.servlet-api) - task: 'integration' - jruby-rack-version: '1.3' # JRuby-Rack 1.3+ requires JRuby 10 ruby-version: jruby-9.4 - jruby-rack-version: '2.0' # JRuby-Rack 1.3+ requires JRuby 10 diff --git a/Mavenfile b/Mavenfile index a3f4b8a5..7cd67832 100644 --- a/Mavenfile +++ b/Mavenfile @@ -10,14 +10,12 @@ properties( 'project.build.sourceEncoding' => 'UTF-8', 'mavengem.wagon.version' => '2.0.3', 'jruby.plugins.version' => '3.0.6', - 'jetty.version' => '9.4.58.v20250814', 'jruby-rack.version' => '[1.2,1.2.99999)', ) # dependencies needed for compilation scope :provided do jar 'org.jruby:jruby', '${jruby.version}' - jar 'org.eclipse.jetty:jetty-webapp', '${jetty.version}' end plugin :clean, '3.5.0' @@ -41,7 +39,7 @@ plugin :invoker, '3.10.1' do 'jruby.version' => '${jruby.version}', 'bundler.version' => '${bundler.version}', 'jruby-rack.version' => '${jruby-rack.version}', - 'jetty.version' => '${jetty.version}', + 'java.ee.version' => '${java.ee.version}', 'style.color' => 'always', }, :goals => ['verify'], diff --git a/Rakefile b/Rakefile index 1ed0c5d3..182836c8 100644 --- a/Rakefile +++ b/Rakefile @@ -21,11 +21,15 @@ task :spec => :jar task :default => :spec +jruby_rack_version = ENV['JRUBY_RACK_VERSION'] +java_ee_version = jruby_rack_version&.include?('[2.') ? 'ee11' : 'ee8' + # use Mavenfile to define :jar task require 'maven/ruby/maven' mvn = Maven::Ruby::Maven.new mvn << "-Djruby.version=#{JRUBY_VERSION}" -mvn << "-Djruby-rack.version=#{ENV['JRUBY_RACK_VERSION']}" if ENV['JRUBY_RACK_VERSION'] +mvn << "-Djruby-rack.version=#{jruby_rack_version}" if jruby_rack_version +mvn << "-Djava.ee.version=#{java_ee_version}" mvn << "-Dbundler.version=#{Bundler::VERSION}" mvn << '--no-transfer-progress' mvn << '--color=always' diff --git a/integration/pom.xml b/integration/pom.xml index b3cb6688..ebfe36b4 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -18,7 +18,7 @@ 9.4.15.0 2.6.3 [1.2,1.2.99999) - 9.4.58.v20250814 + ee8 @@ -156,17 +156,11 @@ - org.eclipse.jetty - jetty-maven-plugin - ${jetty.version} + org.eclipse.jetty.${java.ee.version} + jetty-${java.ee.version}-maven-plugin - - / - 9966 warbler_stop - 0 - true jar @@ -204,7 +198,7 @@ pre-integration-test - deploy-war + start-war diff --git a/integration/rails7_test/pom.xml b/integration/rails7_test/pom.xml index 24cf63f8..ae0c9e47 100644 --- a/integration/rails7_test/pom.xml +++ b/integration/rails7_test/pom.xml @@ -28,8 +28,8 @@ - org.eclipse.jetty - jetty-maven-plugin + org.eclipse.jetty.${java.ee.version} + jetty-${java.ee.version}-maven-plugin start-jetty diff --git a/integration/simple_rack_test/pom.xml b/integration/simple_rack_test/pom.xml index 41586fde..3a7f1c13 100644 --- a/integration/simple_rack_test/pom.xml +++ b/integration/simple_rack_test/pom.xml @@ -24,8 +24,8 @@ - org.eclipse.jetty - jetty-maven-plugin + org.eclipse.jetty.${java.ee.version} + jetty-${java.ee.version}-maven-plugin start-jetty From af06b069a58b70ba2ffb836261cb12f039096a8b Mon Sep 17 00:00:00 2001 From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:28:46 +0800 Subject: [PATCH 5/5] build: try replacing bundler version locks with native support --- .bundle/config | 3 +++ .gitignore | 1 + Mavenfile | 3 +-- Rakefile | 1 - integration/pom.xml | 7 ------- integration/rails7_test/src/main/ruby/.bundle/config | 3 +++ integration/runnable_test/src/main/ruby/.bundle/config | 3 +++ .../runnable_w_bundler_test/src/main/ruby/.bundle/config | 3 +++ spec/rails7_stub/.bundle/config | 3 +++ spec/sample_bundler/.bundle/config | 3 ++- 10 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 .bundle/config create mode 100644 integration/rails7_test/src/main/ruby/.bundle/config create mode 100644 integration/runnable_test/src/main/ruby/.bundle/config create mode 100644 integration/runnable_w_bundler_test/src/main/ruby/.bundle/config create mode 100644 spec/rails7_stub/.bundle/config diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 00000000..704b057f --- /dev/null +++ b/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/.gitignore b/.gitignore index 619554af..c28ec59d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ !spec/rails7_stub/Gemfile.lock *.sqlite3-* +!.bundle/config .bundle .idea .polyglot.Mavenfile diff --git a/Mavenfile b/Mavenfile index 7cd67832..2f3e1597 100644 --- a/Mavenfile +++ b/Mavenfile @@ -26,7 +26,7 @@ plugin :jar, '3.5.0' do end plugin :install, '3.1.4' -gem 'bundler', '${bundler.version}' +gem 'bundler', Bundler::VERSION gem 'jruby-jars', '${jruby.version}' gem 'jruby-rack', '${jruby-rack.version}' @@ -37,7 +37,6 @@ plugin :invoker, '3.10.1' do 'jruby.plugins.version' => '${jruby.plugins.version}', 'warbler.version' => '${project.version}', 'jruby.version' => '${jruby.version}', - 'bundler.version' => '${bundler.version}', 'jruby-rack.version' => '${jruby-rack.version}', 'java.ee.version' => '${java.ee.version}', 'style.color' => 'always', diff --git a/Rakefile b/Rakefile index 182836c8..8564988b 100644 --- a/Rakefile +++ b/Rakefile @@ -30,7 +30,6 @@ mvn = Maven::Ruby::Maven.new mvn << "-Djruby.version=#{JRUBY_VERSION}" mvn << "-Djruby-rack.version=#{jruby_rack_version}" if jruby_rack_version mvn << "-Djava.ee.version=#{java_ee_version}" -mvn << "-Dbundler.version=#{Bundler::VERSION}" mvn << '--no-transfer-progress' mvn << '--color=always' diff --git a/integration/pom.xml b/integration/pom.xml index ebfe36b4..5982088d 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -16,7 +16,6 @@ 2.1.3.pre 9.4.15.0 - 2.6.3 [1.2,1.2.99999) ee8 @@ -35,12 +34,6 @@ ${warbler.version} gem - - rubygems - bundler - ${bundler.version} - gem - rubygems jruby-jars diff --git a/integration/rails7_test/src/main/ruby/.bundle/config b/integration/rails7_test/src/main/ruby/.bundle/config new file mode 100644 index 00000000..704b057f --- /dev/null +++ b/integration/rails7_test/src/main/ruby/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/integration/runnable_test/src/main/ruby/.bundle/config b/integration/runnable_test/src/main/ruby/.bundle/config new file mode 100644 index 00000000..704b057f --- /dev/null +++ b/integration/runnable_test/src/main/ruby/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/integration/runnable_w_bundler_test/src/main/ruby/.bundle/config b/integration/runnable_w_bundler_test/src/main/ruby/.bundle/config new file mode 100644 index 00000000..704b057f --- /dev/null +++ b/integration/runnable_w_bundler_test/src/main/ruby/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/spec/rails7_stub/.bundle/config b/spec/rails7_stub/.bundle/config new file mode 100644 index 00000000..704b057f --- /dev/null +++ b/spec/rails7_stub/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/spec/sample_bundler/.bundle/config b/spec/sample_bundler/.bundle/config index de114412..386d1f58 100644 --- a/spec/sample_bundler/.bundle/config +++ b/spec/sample_bundler/.bundle/config @@ -1,5 +1,6 @@ --- +BUNDLE_VERSION: "system" +BUNDLE_DISABLE_SHARED_GEMS: "true" BUNDLE_FROZEN: "true" BUNDLE_PATH: "vendor/bundle" -BUNDLE_DISABLE_SHARED_GEMS: "1" BUNDLE_DEPLOYMENT: "false"