[ 
https://issues.apache.org/jira/browse/RANGER-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192670#comment-17192670
 ] 

Bing-ok edited comment on RANGER-2984 at 9/16/20, 12:43 PM:
------------------------------------------------------------

Hi [~madhan], I have submit the 
PR-[#75|https://github.com/apache/ranger/pull/75]


was (Author: bing-ok):
Sure, I can create a review.

> “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
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h1. Issue description
> 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.
> However, one method defined in shadowed version 
> _*com.google.guava:guava:16.0.1*_ is referenced by client project 
> _*org.apache.hadoop:hadoop-auth:3.1.1*_, but missing in the actually loaded 
> version _*com.google.guava:guava:25.1-jre*_.
> For instance, the following missing method(defined in 
> _*com.google.guava:guava:16.0.1*_) is actually referenced by 
> _*ranger\unixauthclient*_, which will introduce a runtime error(i.e., 
> "NoSuchMethodError") into _*ranger\unixauthclient*_.\
> _*Missing method: com.google.common.reflect.TypeToken: java.lang.reflect.Type 
> access$400(com.google.common.reflect.TypeToken)*_ is invoked by 
> _*ranger\unixauthclient*_ via the following path:
> {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}
> h1. Suggested fixing solutions
>  1. Upgrade dependency _*org.apache.hadoop:hadoop-auth*_ from _*3.1.1*_ to 
> *_3.3.0_*. Because the newer version _*org.apache.hadoop:hadoop-auth:3.3.0*_ 
> does not invoke the above missing method, such upgrading can solve the 
> problem.
>  2. Change dependency _*com.google.guava:guava*_ from _*25.1-jre*_ to 
> *_24.0-jre_*. Because version *_24.0-jre_* includes the above missing method 
> and is compatible with other versions of _*com.google.guava:guava*_ .
> 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.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){noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to