GeezerVison is showing github.com — Version 4.1.102.Final throws java.lang.NoSuchMethodError with JDK8 · Issue #13729 · netty/netty
Version 4.1.102.Final throws java.lang.NoSuchMethodError with JDK8 #13729
Description
Expected behavior
Version 4.1.102.Final should work with JDK8.
Actual behavior
An exception is thrown when handling requests:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
at io.netty.buffer.PooledByteBuf._internalNioBuffer(PooledByteBuf.java:191)
at io.netty.buffer.PooledByteBuf.internalNioBuffer(PooledByteBuf.java:203)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:750)
Steps to reproduce
- Create a simple project with a ServerBootstrap that includes the version 4.1.102.Final.
- Run the soulution with JDK8.
- Send a request.
Netty version
4.1.102.Final
JVM version (e.g. java -version)
openjdk version "1.8.0_392"
OpenJDK Runtime Environment (build 1.8.0_392-b08)
OpenJDK 64-Bit Server VM (build 25.392-b08, mixed mode)
OS version (e.g. uname -a)
Linux XXXXXXXXXXXX 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Thu Nov 16 10:29:04 EST 2023 x86_64 x86_64 x86_64 GNU/Linux
Comments
Java 9 introduces overridden methods with covariant return types for the java.nio.ByteBuffer class. They now return ByteBuffer, but in the previous versions only a Buffer was returned. Opening the MANIFEST file of version 4.1.102.Final there is an indication that version 19 was used to compile the solution. The previous versions were compiled with JKD8.
Activity
normanmaurer commented on Dec 14, 2023
Metadata
Metadata
Development
No branches or pull requestsIssue actions