twitter / finagle

A fault tolerant, protocol-agnostic RPC system
https://twitter.github.io/finagle
Apache License 2.0
8.78k stars 1.45k forks source link

Illegal reflection warning when using Java 11 #832

Open iPlessmann opened 4 years ago

iPlessmann commented 4 years ago

When running on Java 11, an illegal reflection warning is raised in com.twitter.jvm.Hotspot

Expected behavior

No warning

Actual behavior

[error] WARNING: An illegal reflective access operation has occurred
[error] WARNING: Illegal reflective access by com.twitter.jvm.Hotspot (file:/private/var/folders/7l/d6dbbl010kb7lp0jxnbz1pt00000gn/T/sbt_5e2d645a/target/bb6f250e/34456002/util-jvm_2.12-19.11.0.jar) to field sun.management.ManagementFactoryHelper.jvm
[error] WARNING: Please consider reporting this to the maintainers of com.twitter.jvm.Hotspot
[error] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[error] WARNING: All illegal access operations will be denied in a future release

Steps to reproduce the behavior

Set your environment to use java 11 and then run sbt run on an application that uses Finagle. I am using Finagle 19.11.0

ryanoneill commented 4 years ago

Hi @iPlessmann, as you can see, our Java 11 support still needs some work. Since Twitter forks and maintains our own JVM version internally, we're still using Java 8. Also, perhaps our version of Java 11 has been modified to make this a non-issue.

Would you be interested in submitting a pull request to resolve this? This code to modify is most likely in the util package, either Jvm or JvmStats.