JDK 11 & Netty 4.1.45: PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module...
See original GitHub issueExpected behavior
Startup normally, not throws an exception (debug level).
Actual behavior
Startup throws an exception (debug level).
Steps to reproduce
Startup throws an exception (debug level).
Minimal yet complete reproducer code (or URL to code)
01:47:25.254 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:225)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:219)
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:273)
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92)
at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:279)
at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:150)
at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:96)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:91)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:72)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:44)
at xxx.Server.main(Server.java:19)
01:47:25.257 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
01:47:25.258 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @3c153a1
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
at java.base/java.lang.reflect.Method.invoke(Method.java:558)
at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:335)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:326)
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:273)
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92)
at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:279)
at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:150)
at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:96)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:91)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:72)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:44)
at xxx.Server.main(Server.java:19)
01:47:25.258 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): unavailable
01:47:25.258 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
Netty version:
4.1.45.Final
JVM version (e.g. java -version
)
java version “11.0.6” 2020-01-14 LTS Java™ SE Runtime Environment 18.9 (build 11.0.6+8-LTS) Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
OS version (e.g. uname -a
)
Microsoft Windows [Version 10.0.18363.657]
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Netty- cannot access class jdk.internal.misc.Unsafe
Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @84b8f0f at jdk.internal.reflect ...
Read more >Reflective setAccessible(true) disabled : KTOR-472
PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to ...
Read more >module java.base does not export sun.net.www.protocol.jar to ...
PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to ...
Read more >netty-parent : 4.1.45.Final - Maven Central Repository Search
Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers and clients.
Read more >Requirements for 4.x - Netty.docs
In general the base functionality of each sub-module requires Java 6+ to run and ... has its own ciphers and is not dependent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Set the log level for io.netty to warn or info.
@normanmaurer those errors are posted and reported, again and again, maybe it would make sense to remove the stack traces and just provide a meaningful message instead? This would decrease the noise from similar reports.