Hi, in hmily-2.0.0 (hmily-motan module), duplicate classes with the same fully-qualified name org.jboss.netty.bootstrap.ServerBootstrap are included in two different libraries, i.e., io.netty:netty:3.10.5.Final and org.jboss.netty:netty:3.2.5.Final.
According to "first declaration wins" class loading strategy, only this class in org.jboss.netty:netty:3.2.5.Final can be loaded, and that in io.netty:netty:3.10.5.Final will be shadowed.
By further analyzing, your project expects to invoke method <org.jboss.netty.bootstrap.ServerBootstrap: org.jboss.netty.channel.Channel bind(java.net.SocketAddress)> in io.netty:netty:3.10.5.Final. As it has been shadowed, so that this method defined in org.jboss.netty:netty:3.2.5.Final are actually forced to be referenced via the following invocation path:
<org.dromara.hmily.motan.interceptor.MotanHmilyTransactionInterceptor: java.lang.Object interceptor(org.aspectj.lang.ProceedingJoinPoint)> D:\testcase\TestProject\hmily-2.0.0\hmily-motan\target\classes
<org.dromara.hmily.core.service.impl.HmilyTransactionAspectServiceImpl: java.lang.Object invoke(org.dromara.hmily.common.bean.context.HmilyTransactionContext,org.aspectj.lang.ProceedingJoinPoint)> D:\cEnvironment\repository\org\dromara\hmily-core\2.0.0-RELEASE\hmily-core-2.0.0-RELEASE.jar
<org.dromara.hmily.core.service.handler.StarterHmilyTransactionHandler: java.lang.Object handler(org.aspectj.lang.ProceedingJoinPoint,org.dromara.hmily.common.bean.context.HmilyTransactionContext)> D:\cEnvironment\repository\org\dromara\hmily-core\2.0.0-RELEASE\hmily-core-2.0.0-RELEASE.jar
<ch.qos.logback.classic.net.SimpleSocketServer: void run()> D:\cEnvironment\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar
<org.apache.zookeeper.server.quorum.QuorumPeer: void start()> D:\cEnvironment\repository\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar
<org.apache.zookeeper.server.NettyServerCnxnFactory: void start()> D:\cEnvironment\repository\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar
<org.jboss.netty.bootstrap.ServerBootstrap: org.jboss.netty.channel.Channel bind(java.net.SocketAddress)>
Although both of these two conflicting classes contain the referenced methods (with the same signature), they have different implementations. This issue will not lead to runtime crashes, but it can introduce inconsistent semantic hehavior by changing the control flows and data flows.
Workaround solution:
The easy way to workaround the problem is reversing the declaration order of these two libraries in pom file.
Then, according to "first declaration wins" class loading strategy, class org.jboss.netty.bootstrap.ServerBootstrap in io.netty:netty:3.10.5.Final can be loaded (the version that ninja expects to reference by static analysis).
This fix will not affect other libraries or class, except the above duplicate class.
Dependency tree----
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ hmily-motan ---
[INFO] org.dromara:hmily-motan:jar:2.0.0-RELEASE
…
[INFO] +- com.weibo:motan-springsupport:jar:1.0.0:compile
[INFO] +- com.weibo:motan-transport-netty:jar:1.0.0:compile
[INFO] | - org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] - org.dromara:hmily-core:jar:2.0.0-RELEASE:compile
[INFO] +- org.dromara:hmily-common:jar:2.0.0-RELEASE:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] | +- com.squareup.okhttp3:okhttp:jar:3.7.0:compile
[INFO] | | - com.squareup.okio:okio:jar:1.12.0:compile
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | | - org.apache.commons:commons-pool2:jar:2.5.0:compile
[INFO] | +- org.projectlombok:lombok:jar:1.16.14:compile
[INFO] | +- com.esotericsoftware:kryo-shaded:jar:4.0.0:compile
[INFO] | | +- com.esotericsoftware:minlog:jar:1.3.0:compile
[INFO] | | - org.objenesis:objenesis:jar:2.2:compile
[INFO] | +- com.dyuproject.protostuff:protostuff-core:jar:1.0.8:compile
[INFO] | | - com.dyuproject.protostuff:protostuff-api:jar:1.0.8:compile
[INFO] | +- com.dyuproject.protostuff:protostuff-runtime:jar:1.0.8:compile
[INFO] | | - com.dyuproject.protostuff:protostuff-collectionschema:jar:1.0.8:compile
[INFO] | - org.mongodb:mongo-java-driver:jar:3.5.0:compile
[INFO] +- org.dromara:hmily-annotation:jar:2.0.0-RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:5.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:5.0.7.RELEASE:compile
[INFO] | | - org.springframework:spring-jcl:jar:5.0.7.RELEASE:compile
[INFO] | - org.springframework:spring-tx:jar:5.0.7.RELEASE:compile
[INFO] +- com.zaxxer:HikariCP:jar:3.2.0:compile
[INFO] +- org.springframework.data:spring-data-mongodb:jar:2.0.8.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.0.7.RELEASE:compile
[INFO] | | - org.springframework:spring-aop:jar:5.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:5.0.7.RELEASE:compile
[INFO] | - org.springframework.data:spring-data-commons:jar:2.0.7.RELEASE:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | - commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.9:compile
[INFO] | +- jline:jline:jar:0.9.94:compile
[INFO] | - io.netty:netty:jar:3.10.5.Final:compile
[INFO] - com.lmax:disruptor:jar:3.4.0:compile