You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a unit test in JRuby 9.2 that passes with OpenJDK11, but when I try to use a java Stream from Jruby I get Illegal Access errors on the final methods?
I see similar errors in specs for a large application which I have been trying to upgrade from jdk10.2 & Jruby 9.1.17.0 where we use java streams extensively.
I have tried most of the example code in CallingJavaFromRuby and things appear to be working properly otherwise.
Environment Information
$ uname -a
Darwin me.fios-router.home 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
$ irb
irb(main):001:0> require 'java'
=> false
irb(main):002:0> (1..200).to_a.each.to_java.stream.limit(10)
Traceback (most recent call last):
6: from /usr/local/var/rbenv/versions/jruby-9.2.9.0/bin/irb:13:in `<main>'
5: from org/jruby/RubyKernel.java:1193:in `catch'
4: from org/jruby/RubyKernel.java:1193:in `catch'
3: from org/jruby/RubyKernel.java:1446:in `loop'
2: from org/jruby/RubyKernel.java:1052:in `eval'
1: from (irb):2:in `evaluate'
TypeError (illegal access on 'limit': class org.jruby.javasupport.JavaMethod (in module org.jruby.dist) cannot access a member of class java.util.stream.ReferencePipeline (in module java.base) with modifiers "public final")
When I run the same code from the unit test (condensed to one line) I get a TypeError due to Illegal Access for all the final methods in the ReferencePipeline.
The text was updated successfully, but these errors were encountered:
I see the 9.2.10 milestone is 82% complete. Is it likely this was a regression that might allow me to get my product to production with an earlier release of 9.2.X or should I wait for 9.2.10?
I am also curious about the root cause of the issue, though that might be a bigger topic than you want to take on.
You might be able to get 9.2.8 working. This was a regression in 9.2.9. Basically we fixed one problem (dispatching to non-public methods triggering illegal access errors) and introduced another (dispatching to non-public classes triggering illegal access errors). In your case, we would attempt to bind calls to the "stream" object using the private JDK implementation class (e.g. ReferencePipeline) rather than the public Stream-related interfaces.
9.2.10 should be released in the next couple days!
There appears to be a unit test in JRuby 9.2 that passes with OpenJDK11, but when I try to use a java Stream from Jruby I get Illegal Access errors on the final methods?
I see similar errors in specs for a large application which I have been trying to upgrade from jdk10.2 & Jruby 9.1.17.0 where we use java streams extensively.
I have tried most of the example code in CallingJavaFromRuby and things appear to be working properly otherwise.
Environment Information
java installed from brew
Jruby installed from rbenv (1.1.2)
I have no flags or ruby options set. Nothing installed except bundler (not used here)
Expected Behavior
I expect the code shown in the JRuby unit tests to work.
Actual Behavior
When I run the same code from the unit test (condensed to one line) I get a TypeError due to Illegal Access for all the final methods in the ReferencePipeline.
The text was updated successfully, but these errors were encountered: