Bing-ok created RANGER-2984:
-------------------------------
Summary: “NoSuchMethodErrors” due to multiple versions of
com.google.guava:guava:jar
Key: RANGER-2984
URL: https://issues.apache.org/jira/browse/RANGER-2984
Project: Ranger
Issue Type: Bug
Components: Ranger
Affects Versions: 3.0.0
Reporter: Bing-ok
@Mention someone by typing their name...Hi, there are multiple versions of
_*com.google.guava:guava*_ in _*ranger\unixauthclient*_. As shown in the
following dependency tree, according to Maven's “nearest wins” strategy, only
_*com.google.guava:guava:25.1-jre*_ can be loaded,
_*com.google.guava:guava:16.0.1*_ will be shadowed.
As _*com.google.guava:guava:16.0.1*_ has not been loaded during the building
process, several methods are missing. However, the missing methods:
1. _*com.google.common.reflect.TypeToken: java.lang.reflect.Type
access$400(com.google.common.reflect.TypeToken)*_
{noformat}
paths------
<org.apache.ranger.authentication.unix.jaas.RemoteUnixLoginModule: boolean
commit()> ranger\unixauthclient\target\classes
<org.apache.curator.shaded.com.google.common.collect.Collections2$FilteredCollection:
boolean add(java.lang.Object)>
Repositories\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar
<org.apache.curator.shaded.com.google.common.reflect.TypeToken$TypeFilter$1:
boolean apply(java.lang.Object)>
Repositories\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar
<org.apache.curator.shaded.com.google.common.reflect.TypeToken$TypeFilter$1:
boolean apply(com.google.common.reflect.TypeToken)>
Repositories\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar
<com.google.common.reflect.TypeToken: java.lang.reflect.Type
access$400(com.google.common.reflect.TypeToken)>{noformat}
The above missing methods are actually referenced by _*ranger\unixauthclient*_,
which will cause “NoSuchMethodErrors” at runtime.
Suggested fixing solutions:
1. Upgrade dependency _*org.apache.hadoop:hadoop-auth*_ from _*3.1.1*_ to
*_3.3.0_*. Because one conflicting library version
_*com.google.guava:guava:16.0.1*_ is transitively introduced by
_*org.apache.hadoop:hadoop-auth:3.3.0*_. Upgrading dependency
_*org.apache.hadoop:hadoop-auth*_ from _*3.1.1*_ to *_3.3.0_* can solve this
dependency conflict.
2. Change dependency _*com.google.guava:guava*_ from _*25.1-jre*_ to
*_24.0-jre_*.
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,
Dependency tree----
[INFO] org.apache.ranger:unixauthclient:jar:3.0.0-SNAPSHOT
[INFO] +- *com.google.guava:guava:jar:25.1-jre:compile*
[INFO] \- org.apache.hadoop:hadoop-auth:jar:3.1.1:compile
[INFO] +- org.apache.curator:curator-framework:jar:2.12.0:compile
[INFO] | \- org.apache.curator:curator-client:jar:2.12.0:compile
[INFO] | \- *(com.google.guava:guava:jar:16.0.1:compile - omitted for conflict
with 25.1-jre)*
[INFO] \- (com.google.guava:guava:jar:11.0.2:compile - omitted for conflict
with 25.1-jre)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)