Skip to content

Class loader not working with jdk9 #4846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
monkstone opened this issue Nov 9, 2017 · 3 comments
Closed

Class loader not working with jdk9 #4846

monkstone opened this issue Nov 9, 2017 · 3 comments

Comments

@monkstone
Copy link
Contributor

I know it is early days for jdk9 support (and I'm not 100% sure jdk9 processing.org is ready yet) but this result seems to suggest problem with the jruby java classloader.

Environment

jruby 9.1.14.0 (2.3.3) 2017-11-08 2176f24 Java HotSpot(TM) 64-Bit Server VM 9+181 on 9+181 +jit [linux-x86_64]

Linux tux-PC-2163 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

Works with jdk8
jruby 9.1.14.0 (2.3.3) 2017-11-08 2176f24 OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12 +jit [linux-x86_64]

Actual Behavior

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by jnr.posix.JavaLibCHelper$ReflectiveAccess to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of jnr.posix.JavaLibCHelper$ReflectiveAccess
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
NameError: PApplet not found in packages processing.core; last error: cannot initialize Java class processing.core.PApplet
const_missing at uri:classloader:/jruby/java/core_ext/module.rb:45
module:RbProcessing at /home/tux/animationloop/lib/rbprocessing/app.rb:6

at /home/tux/animationloop/lib/rbprocessing/app.rb:2
require at org/jruby/RubyKernel.java:955
(root) at uri:classloader:/jruby/kernel/kernel.rb:1
at uri:classloader:/jruby/kernel/kernel.rb:13
require at org/jruby/RubyKernel.java:955
(root) at /home/tux/animationloop/lib/rbprocessing.rb:10
at test.rb:1.

See https://github.com/monkstone/rbprocessing for test

@headius
Copy link
Member

headius commented Nov 9, 2017

Ok, looks like there's more than meets the eye here.

The warnings are to be expected; JDK9 warns about "illegal" reflection access, but still allows it. The reason why the applet fails to load is not apparent, though. It appears more likely to be something in processing.org that doesn't initialize on JDK9, and that cascades out to JRuby as a NameError when we can't load the class. The "cannot initialize Java class" tells us this is a problem loading PApplet on JDK9.

I'm going to punt this back to you to investigate whether PApplet even works on JDK9. Until we have confirmation that processing.org works, I don't want to spend too much time on this.

@monkstone
Copy link
Contributor Author

Thanks for looking at issue, I'm now better equipped to explore it further, just in case it comes back to jruby I propose to leave open for now.

@monkstone
Copy link
Contributor Author

monkstone commented Nov 10, 2017

It seems there was a stupid simple reason for PApplet failure,it checked version type and expected a . in version, that my version did not have. I have since updated to jdk-9.0.1 and there is now another issue with a protected method, so I'm closing this issue and creating a new issue.

@headius headius added this to the Invalid or Duplicate milestone Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants