Originally Posted by
newby
WARNING: An illegal
reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.netty.util.internal.ByteBufferUtil (file:/C:/Users/Administrator/Desktop/eclipse-workspace/DawnX%20Server/lib/netty-3.4.6.Final.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.jboss.netty.util.internal.ByteBufferUtil
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
Netty should still work despite the warnings, you might want to use Java 8 (JDK 1.8).. that should get rid of it in general...
I think it shows this message in Java 9 and above.
IF, it genuinely doesn't work, I found this hotfix on github:
Code:
private static void disableWarning() {
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafe.setAccessible(true);
Unsafe u = (Unsafe) theUnsafe.get(null);
Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
Field logger = cls.getDeclaredField("logger");
u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
} catch (Exception e) {
// ignore
}
}
Source: https://github.com/netty/netty/issues/7254
Originally Posted by
Tutus Frutus
Netty should still work despite the warnings, you might want to use Java 8 (JDK 1.8).. that should get rid of it in general...
I think it shows this message in Java 9 and above.
IF, it genuinely doesn't work, I found this hotfix on github:
Code:
private static void disableWarning() {
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafe.setAccessible(true);
Unsafe u = (Unsafe) theUnsafe.get(null);
Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
Field logger = cls.getDeclaredField("logger");
u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
} catch (Exception e) {
// ignore
}
}
Source:
https://github.com/netty/netty/issues/7254
Do note: You should probably rewrite the code to not use Reflectives anymore... the code is just to log/catch the warning.. apparently it still works, but it's an ugly hotfix.
The site also states someone did not have the issue with this version: 4.1.43.Final.