Skip to content

starting jruby: "An illegal reflective access operation has occurred" #6100

@nmingotti

Description

@nmingotti

I get ugly warnings when I run jruby in my platform.

OS:

    $> uname -a
    FreeBSD fbs-slacmac 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64

    $> java --version
    openjdk 11.0.5 2019-10-15
    OpenJDK Runtime Environment (build 11.0.5+10-1)
    OpenJDK 64-Bit Server VM (build 11.0.5+10-1, mixed mode)

    $> jruby --version
    jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e OpenJDK 64-Bit Server VM 11.0.5+10-1 on 11.0.5+10-1 +jit [freebsd-x86_64]

    $> jruby 
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method sun.nio.ch.NativeThread.signal(long)
    WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
    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


    $> jruby -J--illegal-access=debug -S irb 
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method sun.nio.ch.NativeThread.signal(long)
        at com.headius.backport9.modules.Modules.checkOpen(Modules.java:58)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:40)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:30)
        at org.jruby.javasupport.Java.trySetAccessible(Java.java:1657)
        at org.jruby.RubyProcess.<clinit>(RubyProcess.java:940)
        at org.jruby.Ruby.initCore(Ruby.java:1572)
        at org.jruby.Ruby.bootstrap(Ruby.java:1339)
        at org.jruby.Ruby.init(Ruby.java:1236)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method sun.nio.ch.NativeThread.current()
        at com.headius.backport9.modules.Modules.checkOpen(Modules.java:58)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:40)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:30)
        at org.jruby.javasupport.Java.trySetAccessible(Java.java:1657)
        at org.jruby.RubyProcess.<clinit>(RubyProcess.java:940)
        at org.jruby.Ruby.initCore(Ruby.java:1572)
        at org.jruby.Ruby.bootstrap(Ruby.java:1339)
        at org.jruby.Ruby.init(Ruby.java:1236)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)

WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method java.lang.Object.finalize()
        at com.headius.backport9.modules.Modules.checkOpen(Modules.java:58)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:40)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:30)
        at org.jruby.javasupport.binding.MethodGatherer$PartitionedMethods.filterAccessible(MethodGatherer.java:646)
        at org.jruby.javasupport.binding.MethodGatherer$PartitionedMethods.<init>(MethodGatherer.java:626)
        at org.jruby.javasupport.binding.MethodGatherer$2.computeValue(MethodGatherer.java:253)
        at org.jruby.javasupport.binding.MethodGatherer$2.computeValue(MethodGatherer.java:250)
        at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:226)
        at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:208)
        at java.base/java.lang.ClassValue.get(ClassValue.java:114)
        at org.jruby.javasupport.binding.MethodGatherer.getMethods(MethodGatherer.java:161)
        at org.jruby.javasupport.binding.MethodGatherer.setupMethods(MethodGatherer.java:530)
        at org.jruby.javasupport.binding.MethodGatherer.initialize(MethodGatherer.java:122)
        at org.jruby.javasupport.binding.ClassInitializer.initialize(ClassInitializer.java:63)
        at org.jruby.javasupport.binding.Initializer.setupProxyClass(Initializer.java:54)
        at org.jruby.javasupport.Java.createProxyClass(Java.java:549)
        at org.jruby.javasupport.Java.generateClassProxy(Java.java:498)
        at org.jruby.javasupport.Java.createProxyClassForClass(Java.java:463)
        at org.jruby.javasupport.JavaSupportImpl$3.computeValue(JavaSupportImpl.java:127)
        at org.jruby.javasupport.JavaSupportImpl$3.computeValue(JavaSupportImpl.java:119)
        at org.jruby.util.collections.MapBasedClassValue.get(MapBasedClassValue.java:25)
        at org.jruby.javasupport.JavaSupportImpl.getProxyClassFromCache(JavaSupportImpl.java:202)
        at org.jruby.javasupport.Java.getProxyClass(Java.java:430)
        at org.jruby.javasupport.JavaClass.getProxyClass(JavaClass.java:104)
        at org.jruby.javasupport.Java.load(Java.java:128)
        at org.jruby.Ruby.initJavaSupport(Ruby.java:1754)
        at org.jruby.Ruby.init(Ruby.java:1268)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)

WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method java.lang.Object.clone()
        at com.headius.backport9.modules.Modules.checkOpen(Modules.java:58)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:40)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:30)
        at org.jruby.javasupport.binding.MethodGatherer$PartitionedMethods.filterAccessible(MethodGatherer.java:646)
        at org.jruby.javasupport.binding.MethodGatherer$PartitionedMethods.<init>(MethodGatherer.java:626)
        at org.jruby.javasupport.binding.MethodGatherer$2.computeValue(MethodGatherer.java:253)
        at org.jruby.javasupport.binding.MethodGatherer$2.computeValue(MethodGatherer.java:250)
        at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:226)
        at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:208)
        at java.base/java.lang.ClassValue.get(ClassValue.java:114)
        at org.jruby.javasupport.binding.MethodGatherer.getMethods(MethodGatherer.java:161)
        at org.jruby.javasupport.binding.MethodGatherer.setupMethods(MethodGatherer.java:530)
        at org.jruby.javasupport.binding.MethodGatherer.initialize(MethodGatherer.java:122)
        at org.jruby.javasupport.binding.ClassInitializer.initialize(ClassInitializer.java:63)
        at org.jruby.javasupport.binding.Initializer.setupProxyClass(Initializer.java:54)
        at org.jruby.javasupport.Java.createProxyClass(Java.java:549)
        at org.jruby.javasupport.Java.generateClassProxy(Java.java:498)
        at org.jruby.javasupport.Java.createProxyClassForClass(Java.java:463)
        at org.jruby.javasupport.JavaSupportImpl$3.computeValue(JavaSupportImpl.java:127)
        at org.jruby.javasupport.JavaSupportImpl$3.computeValue(JavaSupportImpl.java:119)
        at org.jruby.util.collections.MapBasedClassValue.get(MapBasedClassValue.java:25)
        at org.jruby.javasupport.JavaSupportImpl.getProxyClassFromCache(JavaSupportImpl.java:202)
        at org.jruby.javasupport.Java.getProxyClass(Java.java:430)
        at org.jruby.javasupport.JavaClass.getProxyClass(JavaClass.java:104)
        at org.jruby.javasupport.Java.load(Java.java:128)
        at org.jruby.Ruby.initJavaSupport(Ruby.java:1754)
        at org.jruby.Ruby.init(Ruby.java:1268)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)

WARNING: Illegal reflective access by org.jruby.util.SecurityHelper to field java.lang.reflect.Field.modifiers
        at org.jruby.util.SecurityHelper.setNonRestrictedJava8(SecurityHelper.java:67)
        at org.jruby.util.SecurityHelper.checkCryptoRestrictions(SecurityHelper.java:37)
        at org.jruby.Ruby.init(Ruby.java:1291)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)
WARNING: Illegal reflective access by org.jruby.util.SecurityHelper to field javax.crypto.JceSecurity.isRestricted
        at org.jruby.util.SecurityHelper.setNonRestrictedJava8(SecurityHelper.java:71)
        at org.jruby.util.SecurityHelper.checkCryptoRestrictions(SecurityHelper.java:37)
        at org.jruby.Ruby.init(Ruby.java:1291)
        at org.jruby.Ruby.newInstance(Ruby.java:371)
        at org.jruby.Main.internalRun(Main.java:273)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)

WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to field java.io.FileDescriptor.fd
        at com.headius.backport9.modules.Modules.checkOpen(Modules.java:58)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:40)
        at com.headius.backport9.modules.Modules.trySetAccessible(Modules.java:30)
        at org.jruby.javasupport.Java.trySetAccessible(Java.java:1657)
        at org.jruby.util.io.FilenoUtil$ReflectiveAccess.<clinit>(FilenoUtil.java:236)
        at org.jruby.util.io.FilenoUtil.getFilenoUsingReflection(FilenoUtil.java:123)
        at org.jruby.util.io.FilenoUtil.filenoFrom(FilenoUtil.java:119)
        at org.jruby.util.io.ChannelFD.initFileno(ChannelFD.java:47)
        at org.jruby.util.io.ChannelFD.<init>(ChannelFD.java:33)
        at org.jruby.util.io.ChannelFD.<init>(ChannelFD.java:43)
        at org.jruby.RubyIO.<init>(RubyIO.java:174)
        at org.jruby.RubyFile.<init>(RubyFile.java:281)
        at org.jruby.parser.Parser.parse(Parser.java:100)
        at org.jruby.Ruby.parseFileAndGetAST(Ruby.java:2703)
        at org.jruby.Ruby.parseFileFromMainAndGetAST(Ruby.java:2696)
        at org.jruby.Ruby.parseFileFromMain(Ruby.java:2680)
        at org.jruby.Ruby.parseFromMain(Ruby.java:643)
        at org.jruby.Ruby.runFromMain(Ruby.java:589)
        at org.jruby.Main.doRunFromMain(Main.java:412)
        at org.jruby.Main.internalRun(Main.java:304)
        at org.jruby.Main.run(Main.java:234)
        at org.jruby.Main.main(Main.java:206)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions