Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError: in redisson and netty integration

I have built my own library of custom methods using redisson 3.4.4. This internally uses netty-all-4.1.13.Final.jar.

When I build my library and try to use with a project I get following exception,

java.lang.NoSuchMethodError: io.netty.bootstrap.Bootstrap.config()Lio/netty/bootstrap/BootstrapConfig;
at org.redisson.client.RedisClient$1$1.operationComplete(RedisClient.java:214)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:680)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:567)
at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:406)
at org.redisson.misc.RedissonPromise.trySuccess(RedissonPromise.java:78)
at org.redisson.client.handler.BaseConnectionHandler.channelActive(BaseConnectionHandler.java:85)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:212)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:198)
at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:818)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:252)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:282)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:748)

I did further digging into the "netty-all-4.1.13.Final.jar" and able to find that method "io.netty.bootstrap.Bootstrap.config()" with return type "io/netty/bootstrap/BootstrapConfig" is actually present.

Why am I getting "method not found error" here then if its present in jar/library I am using??

like image 507
Rahul Borkar Avatar asked Mar 28 '26 20:03

Rahul Borkar


1 Answers

You may have defined the same class with two versions; an old Version without this method, and a new class with this method!

Solution: You can remove the class that contain this method from the package. If the Problem remains, that means that your Project reads another Version from the class. find the old Version and remove it!

And please don't steal the ideas and rewrite them as they are yours

like image 165
Hasan Avatar answered Apr 01 '26 08:04

Hasan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!