[ https://issues.apache.org/jira/browse/ATLAS-3906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17195501#comment-17195501 ]
Madhan Neethiraj commented on ATLAS-3906: ----------------------------------------- [~Bing-ok] - thanks for the detailed description and the suggestions to address the issue. Upgrading version of org.apache.hadoop:hadoop-common from 3.1.1 to 3.3.0 seems like a good option. Can you please submit a review with this fix? > “NoSuchMethodErrors” due to multiple versions of > org.apache.curator:curator-client:jar > -------------------------------------------------------------------------------------- > > Key: ATLAS-3906 > URL: https://issues.apache.org/jira/browse/ATLAS-3906 > Project: Atlas > Issue Type: Bug > Affects Versions: 3.0.0 > Reporter: Bing-ok > Priority: Major > > h1. Issue description > Hi, there are multiple versions of _*org.apache.curator:curator-client*_ in > _*atlas/server-api*_. As shown in the following dependency tree, library > _*org.apache.curator:curator-client:2.12.0*_ is transitively introduced by > *_org.apache.hadoop:hadoop-auth:3.1.1_*, but has been managed to be version > *_4.0.1_*. > However, one method defined in shadowed version > _*org.apache.curator:curator-client:2.12.0*_ is referenced by client project > via *_org.apache.hadoop:hadoop-auth:3.1.1_*, but missing in the actually > loaded version _*org.apache.curator:curator-client:4.0.1*_. > For instance, the following missing method(defined in > _*org.apache.curator:curator-client:2.12.0*_) is actually referenced by > _*atlas/server-api*_, which will introduce a runtime error(i.e., > "NoSuchMethodError") into _*atlas/server-api*_. > _*Missing method: org.codelibs.core.lang.StringUtil: java.lang.String > newStringUnsafe(char[])*_ is invoked by _*atlas/server-api*_ via the > following path: > {noformat} > paths------ > <org.apache.atlas.RequestContext: org.apache.atlas.model.instance.AtlasEntity > getEntity(java.lang.String)> atlas\server-api\target\classes > <org.apache.curator.shaded.com.google.common.collect.Maps$AsMapView: > java.lang.Object get(java.lang.Object)> > Repositories\org\apache\curator\curator-client\4.0.1\curator-client-4.0.1.jar > <org.apache.curator.framework.imps.CuratorFrameworkImpl$5: java.lang.Object > apply(java.lang.Object)> > Repositories\org\apache\curator\curator-framework\4.0.1\curator-framework-4.0.1.jar > <org.apache.curator.framework.imps.CuratorFrameworkImpl$5: java.lang.Void > apply(org.apache.curator.framework.api.CuratorListener)> > Repositories\org\apache\curator\curator-framework\4.0.1\curator-framework-4.0.1.jar > <org.apache.curator.utils.ThreadUtils: void > checkInterrupted(java.lang.Throwable)>{noformat} > h1. Suggested fixing solutions > 1. Upgrade dependency *_org.apache.hadoop:hadoop-common_* from _*3.1.1*_ to > *_3.3.0_*. Because the newer version > *_org.apache.hadoop:hadoop-common:3.3.0_* does not invoke the above missing > method, such upgrading can solve the problem. > 2. Declare a direct dependency _*org.apache.curator:curator-client:2.12.0*_ > in the pom file of _*atlas/server-api*_, to override > _*org.apache.curator:curator-client*_'s managed version. > 3. Use configuration attribute <dependencyManagement> to unify the version of > library _*org.apache.curator:curator-client*_ to be _*2.12.0*_ in > _*atlas/server-api*_'s pom file. > Please let me know which solution do you prefer? I can submit a PR to fix it. > Thank you very much for your attention. > Best regards, > h1. Dependency tree---- > {noformat} > [INFO] org.apache.atlas:atlas-server-api:jar:3.0.0-SNAPSHOT > [INFO] - org.apache.hadoop:hadoop-common:jar:3.1.1:compile > [INFO] +- org.apache.hadoop:hadoop-auth:jar:3.1.1:compile > [INFO] | - org.apache.curator:curator-framework:jar:4.0.1:compile (version > managed from 2.12.0) > [INFO] | - _*(org.apache.curator:curator-client:jar:4.0.1:compile - version > managed from 2.12.0; omitted for duplicate)*_ > [INFO] - _*org.apache.curator:curator-client:jar:4.0.1:compile*_{noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)