You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Xuze Yang (Jira)" <ji...@apache.org> on 2022/10/14 08:55:00 UTC

[jira] [Commented] (RANGER-3946) ranger-yarn-plugin missing commons-lang-2.6.jar

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

Xuze Yang commented on RANGER-3946:
-----------------------------------

ranger-yarn-plugin can work well with hadoop-2.8.5(with some small changes) and hadoop-2.10.1, because the two versions of hadoop rely on commons-lang-2.6.jar, but in 3.2.4 (which may also involve other versions), the dependency on commons-lang-2.6.jar is removed. Therefore, it is necessary to take common-lang.jar as a dependency. 

Just like in ranger-hdfs-plugin, we also need to package commons-lang in yarn-plugin
{code:java}
<binaries>
  <outputDirectory>lib/ranger-hdfs-plugin-impl</outputDirectory>
  <includeDependencies>true</includeDependencies>
  <unpack>false</unpack>
  <directoryMode>755</directoryMode>
  <fileMode>644</fileMode>
  <includes>
    <include>commons-lang:commons-lang</include>
    <include>org.eclipse.jetty:jetty-client:jar:${jetty-client.version}</include>
    <include>org.apache.httpcomponents:httpmime:jar:${httpcomponents.httpmime.version}</include>
    <include>org.apache.httpcomponents:httpclient:jar:${httpcomponents.httpclient.version}</include>
    <include>org.apache.httpcomponents:httpcore:jar:${httpcomponents.httpcore.version}</include>
    <include>org.noggit:noggit:jar:${noggit.version}</include>
    <include>org.apache.solr:solr-solrj:jar:${solr.version}</include>
    <include>com.kstruct:gethostname4j:jar:${kstruct.gethostname4j.version}</include>
    <include>net.java.dev.jna:jna:jar:${jna.version}</include>
    <include>net.java.dev.jna:jna-platform:jar:${jna-platform.version}</include>
    <include>org.elasticsearch:elasticsearch</include>
    <include>org.elasticsearch:elasticsearch-core</include>
    <include>org.elasticsearch:elasticsearch-x-content</include>
    <include>org.elasticsearch.client:elasticsearch-rest-client</include>
    <include>org.elasticsearch.client:elasticsearch-rest-high-level-client</include>
    <include>org.elasticsearch.plugin:rank-eval-client</include>
    <include>org.elasticsearch.plugin:lang-mustache-client</include>
    <include>org.apache.httpcomponents:httpcore-nio:jar:${httpcomponents.httpcore.version}</include>
    <include>org.apache.httpcomponents:httpasyncclient:jar:${httpcomponents.httpasyncclient.version}</include>
    <include>org.apache.lucene:lucene-core</include>
    <include>joda-time:joda-time</include>
    <include>com.carrotsearch:hppc</include>
  </includes>
</binaries> {code}

> ranger-yarn-plugin missing commons-lang-2.6.jar
> -----------------------------------------------
>
>                 Key: RANGER-3946
>                 URL: https://issues.apache.org/jira/browse/RANGER-3946
>             Project: Ranger
>          Issue Type: Bug
>          Components: plugins
>    Affects Versions: 2.1.0
>            Reporter: Xuze Yang
>            Priority: Major
>
> when implement ranger-2.1.0-yarn-plugin in hadoop-3.2.4. a error occured shown below:
> {code:java}
> 2022-10-14 15:12:54,561 INFO org.apache.ranger.plugin.classloader.RangerPluginClassLoaderUtil: getFilesInDirectory('/cloud/service/ranger-2.1.0-yarn-plugin/lib/ranger-yarn-plugin-impl'): adding /cloud/service/ranger-2.1.0-yarn-plugin/lib/ranger-yarn-plugin-impl/solr-solrj-7.7.1.jar
> 2022-10-14 15:12:54,582 ERROR org.apache.hadoop.yarn.server.resourcemanager.ResourceManager: Error starting ResourceManager
> java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
>         at org.apache.ranger.authorization.hadoop.config.RangerConfiguration.getFileLocation(RangerConfiguration.java:78)
>         at org.apache.ranger.authorization.hadoop.config.RangerConfiguration.addResourceIfReadable(RangerConfiguration.java:47)
>         at org.apache.ranger.authorization.hadoop.config.RangerPluginConfig.addResourcesForServiceType(RangerPluginConfig.java:199)
>         at org.apache.ranger.authorization.hadoop.config.RangerPluginConfig.<init>(RangerPluginConfig.java:60)
>         at org.apache.ranger.plugin.service.RangerBasePlugin.<init>(RangerBasePlugin.java:73)
>         at org.apache.ranger.authorization.yarn.authorizer.RangerYarnPlugin.<init>(RangerYarnAuthorizer.java:287)
>         at org.apache.ranger.authorization.yarn.authorizer.RangerYarnAuthorizer.init(RangerYarnAuthorizer.java:82)
>         at org.apache.ranger.authorization.yarn.authorizer.RangerYarnAuthorizer.init(RangerYarnAuthorizer.java:95)
>         at org.apache.hadoop.yarn.security.YarnAuthorizationProvider.getInstance(YarnAuthorizationProvider.java:57)
>         at org.apache.hadoop.yarn.server.resourcemanager.security.QueueACLsManager.<init>(QueueACLsManager.java:58)
>         at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.createQueueACLsManager(ResourceManager.java:434)
>         at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager$RMActiveServices.serviceInit(ResourceManager.java:833)
>         at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
>         at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.createAndInitActiveServices(ResourceManager.java:1373)
>         at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:332)
>         at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
>         at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1657)
> Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
>         at java.lang.ClassLoader.findClass(ClassLoader.java:523)
>         at org.apache.ranger.plugin.classloader.RangerPluginClassLoader$MyClassLoader.findClass(RangerPluginClassLoader.java:290)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
>         at org.apache.ranger.plugin.classloader.RangerPluginClassLoader.loadClass(RangerPluginClassLoader.java:132)
>         ... 17 more {code}
> This error shows that the commons-lang-2.6.jar cannot be found in the classpath.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)