question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Illegal reflective access warnings when running Netty with Java 9

See original GitHub issue

Expected behavior

No warnings.

Actual behavior

Warnings when starting netty with java 9:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/doom369/.m2/repository/io/netty/netty-common/4.1.16.Final/netty-common-4.1.16.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
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

with --illegal-access=warn enabled :

WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/doom369/.m2/repository/io/netty/netty-common/4.1.16.Final/netty-common-4.1.16.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/doom369/.m2/repository/io/netty/netty-common/4.1.16.Final/netty-common-4.1.16.Final.jar) to method java.nio.Bits.unaligned()

Steps to reproduce

Run any netty server with Java 9.

Netty version

4.1.16.Final

JVM version (e.g. java -version)

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

Maybe it would be better to do not access above classes in case of java 9 to avoid warning?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

23reactions
rockwotjcommented, Oct 5, 2017

Can we re-open this to actually solve the issue, I’d hate for things to break later on because this never got fixed?

The warning is quite clear this will break later on.

4reactions
dynawinkcommented, Oct 8, 2019

The error still occurs with netty 5.0.0.Alpha2. Please reopen the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java 9 Illegal Reflective Access Warning - Baeldung
Before Java 9, the Java Reflection API has a superpower: It could gain access to the non-public class members without limitation.
Read more >
How to hide warning "Illegal reflective access" in java 9 ...
There are ways to disable illegal access warning, though I do not recommend doing this. 1. Simple approach. Since the warning is printed...
Read more >
Java – How to hide warning “Illegal reflective access” in java 9 ...
javajava-9jvmnetty. I just tried to run my server with Java 9 and got next warning: WARNING: An illegal reflective access operation has occurred...
Read more >
An illegal reflective access operation has occurred when ...
Java Agent: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.forgerock.openam.sdk.com.
Read more >
Java 9 Support - 2.0.0-rc-1 - Ratpack
3.26 Known Java 9 Errors/Warning messages. The following are messages emitted by Java 9+ that are expected. Guice illegal reflective access in issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found