简体   繁体   中英

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??

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

I modified my classpath used for running application to include netty-all-4.1.13.Final.jar before some jars which I felt internally using netty's older version library.

Solved as of now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM