Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“NoSuchMethodErrors” due to multiple versions of io.netty:netty-all:jar #1020

Open
Bing-ok opened this issue Nov 15, 2023 · 1 comment
Open

Comments

@Bing-ok
Copy link

Bing-ok commented Nov 15, 2023

Issue description

Hi, there are multiple versions of io.netty:netty-all in dubbo-samples-ssl/dubbo-samples-ssl-provider of version 1.0-SNAPSHOT. As shown in the following dependency tree, according to Maven "nearest wins" strategy, only io.netty:netty-all:4.1.36.Final can be loaded, io.netty:netty-all:4.1.25.Final will be shadowed.

However, several methods defined in shadowed version io.netty:netty-all:4.1.25.Final are referenced by client project via org.apache.dubbo:dubbo:2.7.7 but missing in the actually loaded version io.netty:netty-all:4.1.36.Final.

For instance, the following missing method(defined in io.netty:netty-all:4.1.25.Final) are actually referenced by dubbo-samples-ssl-provider, which will introduce a runtime error(i.e., "NoSuchMethodError") into dubbo-samples-ssl-provider.

  1. <io.netty.channel.nio.NioEventLoopGroup: void (int,java.util.concurrent.ThreadFactory)> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> 
org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
<io.netty.channel.nio.NioEventLoopGroup: void init (int,java.util.concurrent.ThreadFactory)>
  1. <io.netty.channel.DelegatingChannelPromiseNotifier: io.netty.channel.ChannelFuture sync()> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
io.netty.channel.DelegatingChannelPromiseNotifier: io.netty.channel.ChannelFuture sync()
  1. <io.netty.channel.VoidChannelPromise: io.netty.channel.ChannelFuture sync()> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
io.netty.channel.DelegatingChannelPromiseNotifier: io.netty.channel.ChannelFuture sync()
  1. <io.netty.bootstrap.AbstractBootstrap: io.netty.channel.ChannelFuture bind(java.lang.String,int)> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
io.netty.channel.DelegatingChannelPromiseNotifier: io.netty.channel.ChannelFuture sync()
  1. <io.netty.bootstrap.ServerBootstrap: io.netty.bootstrap.ServerBootstrap group(io.netty.channel.EventLoopGroup,io.netty.channel.EventLoopGroup)> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
<io.netty.bootstrap.ServerBootstrap: io.netty.bootstrap.ServerBootstrap group(io.netty.channel.EventLoopGroup,io.netty.channel.EventLoopGroup)>
  1. <io.netty.bootstrap.ServerBootstrap: io.netty.bootstrap.ServerBootstrap childHandler(io.netty.channel.ChannelHandler)> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
<io.netty.bootstrap.ServerBootstrap: io.netty.bootstrap.ServerBootstrap childHandler(io.netty.channel.ChannelHandler)>
  1. <io.netty.bootstrap.AbstractBootstrap: io.netty.channel.ChannelFuture bind(int)> is invoked by dubbo-samples-ssl-provider via the following path:
path--
<org.apache.dubbo.samples.basic.SslBasicProvider: void main(java.lang.String[])> org.apache.dubbo:dubbo-samples-ssl-provider:1.0-SNAPSHOT;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: org.apache.dubbo.config.bootstrap.DubboBootstrap start()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.bootstrap.DubboBootstrap: void exportMetadataService()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.metadata.MetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter: org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void export()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExport()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrls()> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.config.ServiceConfig: void doExportUrlsFor1Protocol(org.apache.dubbo.config.ProtocolConfig,java.util.List)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.protocol.QosProtocolWrapper: void startQosServer(org.apache.dubbo.common.URL)> org.apache.dubbo:dubbo:2.7.7;
<org.apache.dubbo.qos.server.Server: void start()> org.apache.dubbo:dubbo:2.7.7;
<io.netty.bootstrap.AbstractBootstrap: io.netty.channel.ChannelFuture bind(int)>

Suggested fixing solutions:

  1. Change direct dependency io.netty:netty-all from 4.1.36.Final to 4.1.25.Final. Because version 4.1.25.Final includes the above missing methods and is compatible with other versions of io.netty:netty-all in the project.

Please let me know if this solution you agree to? I can submit a PR to fix it.

Thank you very much for your attention.
Best regards,

Dependency tree----


[INFO] |  |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  \- org.springframework:spring-expression:jar:4.3.16.RELEASE:compile
[INFO] |  |     \- (org.springframework:spring-core:jar:4.3.16.RELEASE:compile - omitted for duplicate)
[INFO] |  +- com.alibaba.spring:spring-context-support:jar:1.0.6:compile
[INFO] |  +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |  +- (io.netty:netty-all:jar:4.1.36.Final:compile - version managed from 4.1.25.Final; omitted for duplicate)
[INFO] |  +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.20:compile
[INFO] +- org.apache.dubbo:dubbo-dependencies-zookeeper:pom:2.7.7:compile
[INFO] |  +- org.apache.curator:curator-recipes:jar:4.0.1:compile
[INFO] |  |  \- org.apache.curator:curator-framework:jar:4.0.1:compile
@AlbumenJ
Copy link
Member

Please check on the latest 3.2.x version. This should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants