Skip to content

JRuby 10 / JDK 21 compatibility issue with activerecord-jdbc-adapter (WeakMap error) #2494

@qisantanu

Description

@qisantanu

Summary

I'm trying to use activerecord-jdbc-adapter with JRuby 10 (Java 21), but encountering a runtime error when loading the gem.

It appears to be related to changes in JRuby internals (WeakMap), which may not yet be supported by the adapter.


Environment

  • JRuby: 10.x
  • Java: OpenJDK 21
  • Rails: 7.2
  • activerecord-jdbc-adapter: ~> 70.0
  • activerecord-oracle_enhanced-adapter: 7.2.0 (from GitHub)

Error


Steps to Reproduce

  1. Use JRuby 10 with JDK 21
  2. Add the following to Gemfile:
platforms :jruby do
  gem 'activerecord-oracle_enhanced-adapter', '7.2.0', git: 'https://github.com/rsim/oracle-enhanced.git', tag: 'v7.2.0'
  gem 'activerecord-jdbc-adapter', '~> 72.0'
end

Run:

bundle install
rails c

Expected Behavior

The adapter should load correctly and allow establishing a JDBC connection.

Actual Behavior

The application fails to boot due to a WeakMap-related error.

Additional Context

JRuby 10 requires Java 21, so support for this combination would be valuable going forward.
This may be related to internal changes in JRuby’s object space implementation.
Request

Is there any plan to support JRuby 10 / Java 21?

Thanks for maintaining this project 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions