如何使用 Tomcat 10 正确配置身份验证?

如何解决如何使用 Tomcat 10 正确配置身份验证?

我正在使用 Tomcat 10 和 eclipse 来开发 J2E(或 Jakarta EE)Web 应用程序。我遵循了本教程 (http://objis.com/tutoriel-securite-declarative-jee-avec-jaas/#partie2),它看起来很旧(这是一份法语文档,因为我是法语,如果我的英语不完美,请见谅),但我也阅读了 Tomcat 10 文档。
数据源有效,我按照此页面上的说明(https://tomcat.apache.org/tomcat-10.0-doc/jndi-datasource-examples-howto.html#Oracle_8i,_9i_&_10g)进行了测试,但似乎该领域不起作用,因为我无法成功登录。我总是遇到验证错误,即使我使用了正确的登录名和密码。
我尝试了很多“解决方案”来纠正这个问题,但没有一个有效。而且我仍然不知道是否必须将领域标记放在 context.xml、server.xml 或两者中。我尝试了 context.xml 和两者,但我没有看到任何区别。

我的 web.xml :

<?xml version="1.0" encoding="UTF-8"?>
<web-app 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://Java.sun.com/xml/ns/javaee" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
    version="3.0">
      
      <!-- Servlet -->
      
      <servlet>
        <servlet-name>Accueil</servlet-name>
        <servlet-class>servlet.Accueil</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Accueil</servlet-name>
        <url-pattern></url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Bar</servlet-name>
        <servlet-class>servlet.Bar</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Bar</servlet-name>
        <url-pattern>/bar</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Galerie</servlet-name>
        <servlet-class>servlet.Galerie</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Galerie</servlet-name>
        <url-pattern>/galerie</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Cave</servlet-name>
        <servlet-class>servlet.Cave</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Cave</servlet-name>
        <url-pattern>/cave</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Mentions</servlet-name>
        <servlet-class>servlet.Mentions</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Mentions</servlet-name>
        <url-pattern>/mentions-legales</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Plan</servlet-name>
        <servlet-class>servlet.Plan</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Plan</servlet-name>
        <url-pattern>/plan-acces</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Restaurant</servlet-name>
        <servlet-class>servlet.Restaurant</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Restaurant</servlet-name>
        <url-pattern>/restaurant</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>Catalogue</servlet-name>
        <servlet-class>servlet.catalogue</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>Catalogue</servlet-name>
        <url-pattern>/catalogue</url-pattern>
      </servlet-mapping>
      
      <servlet>
        <servlet-name>AdminCatalogue</servlet-name>
        <servlet-class>servlet.AdminCatalogue</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>AdminCatalogue</servlet-name>
        <url-pattern>/admin/administration-catalogue</url-pattern>
      </servlet-mapping>
      
      <security-constraint>
        <display-name>Test authentification Tomcat</display-name>
        <!-- Liste des pages protégées -->
        <web-resource-collection>
            <web-resource-name>Page sécurisée</web-resource-name>
            <url-pattern>/admin/*</url-pattern>
        </web-resource-collection>
        <!-- Rôles des utilisateurs ayant le droit d'y accéder -->
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
        <!-- Connection sécurisée -->
        <!-- <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint> -->
      </security-constraint>
      
      <!-- Configuration de l'authentification -->
      <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>Espace administration</realm-name>
        <form-login-config>
            <form-login-page>/WEB-INF/login.jsp</form-login-page>
            <form-error-page>/WEB-INF/erreur-authentification.jsp</form-error-page>
        </form-login-config>
      </login-config>
      
      <!-- Rôles utilisés dans l'application -->
      <security-role>
        <description>Administrateur</description>
        <role-name>admin</role-name>
      </security-role>
      
      <!-- Ajoute taglibs.jsp au début de chaque jsp -->
      <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <include-prelude>/WEB-INF/taglibs.jsp</include-prelude>
        </jsp-property-group>
      </jsp-config>
      
      <!-- Déclaration de référence à une source de données JNDI -->
      <resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/caradoc</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
      
</web-app>

context.xml :

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License,Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,software
  distributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources. If one of these changes,the    -->
    <!-- web application will be reloaded.                                   -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <!-- Uncomment this to enable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="SESSIONS.ser" />
    -->
    <Resource name="jdbc/caradoc" auth="Container" type="javax.sql.DataSource"
               maxTotal="100" maxIdle="30" maxWaitMillis="10000"
               username="root" password="Caradoc22600!" driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://localhost:3307/caradoc"/>
               
     <Realm className="org.apache.catalina.realm.DataSourceRealm" 
        daraSourceName="jdbc/caradoc" localDataSource="true" userTable="utilisateurs"
        userRoleTable="roles" userNameCol="login" userCredCol="mdp"
        roleNameCol="role">
        <CredentialHandler className="org.apache.catalina.realm.SecretKeyCredentialHandler"
                      algorithm="PBKDF2WithHmacSHA512"
                      iterations="100000"
                      keyLength="256"
                      saltLength="16"
        />
     </Realm>
</Context>

server.xml :

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License,either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container",so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="9000" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor,you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         HTTP Connector: /docs/config/http.html
         AJP  Connector: /docs/config/ajp.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding = "UTF-8" />

    <!-- <Connector port="8443"
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150"
           SSLEnabled="true"
           scheme="https"
           secure="true"
           clientAuth="false"
           sslProtocol="TLS"
           keystoreFile="autosigned-cert.keystore"
           keyAlias="tomcat"
           keystorePass="azertyuiop" /> -->
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />
    -->

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request,and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering,please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Realm className="org.apache.catalina.realm.LockOutRealm">
          <Realm className="org.apache.catalina.realm.DataSourceRealm" 
            daraSourceName="jdbc/caradoc" localDataSource="true" userTable="utilisateurs"
            userRoleTable="roles" userNameCol="login" userCredCol="mdp"
            roleNameCol="role">
            <CredentialHandler className="org.apache.catalina.realm.SecretKeyCredentialHandler"
                          algorithm="PBKDF2WithHmacSHA512"
                          iterations="100000"
                          keyLength="256"
                          saltLength="16"
            />
          </Realm>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve,share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

登录.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Connexion Administrateur</title>
</head>
<body>
    <div align="center">
        <h2>Identification</h2>
    </div>
    <form action="j_security_check" method="post" accept-charset="utf-8">
        <table align="center">
            <tr>
                <td>Login : </td>
                <td><input type="text" name="j_username"/></td>
            </tr>
            <tr>
                <td>Mot de passe : </td>
                <td><input type="password" name="j_password"/></td>
            </tr>
        </table>
        <p align="center"><input type="submit" value="Connexion"/></p>
    </form>
</body>
</html>

erreur-authentifiction.jsp,内容与 login.jsp 相同,但有错误信息。

用户表(用digest.bat获得的密码哈希): User table

登录时带有外键的角色表引用用户表的登录列: Role table

这是我的项目树状,如果它可以帮助:arborescence

所以请有人告诉我我做错了什么吗?

EDIT :如果我们使用 CredentialHandler 标记中指定的参数,我验证了我们找到了正确的哈希,它匹配。

这是我用来验证的java代码:

import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;

import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;

public class test{

    private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
    
    public static byte[] hexStringToByteArray(String s) {
        int len = s.length();
        byte[] data = new byte[len / 2];
        for (int i = 0; i < len; i += 2) {
            data[i / 2] = (byte) ((Character.digit(s.charAt(i),16) << 4)
                                 + Character.digit(s.charAt(i+1),16));
        }
        return data;
    }
    
    public static String bytesToHex(byte[] bytes) {
        char[] hexChars = new char[bytes.length * 2];
        for (int j = 0; j < bytes.length; j++) {
            int v = bytes[j] & 0xFF;
            hexChars[j * 2] = HEX_ARRAY[v >>> 4];
            hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
        }
        return new String(hexChars);
    }
    
    public static void main(String[] args) throws NoSuchAlgorithmException,InvalidKeySpecException
    {
        String password = "password";
        byte[] salt = hexStringToByteArray("e0cfcb0169f81fc46c861ecefeb7446b");

        KeySpec spec = new PBEKeySpec(password.toCharArray(),salt,100000,256);
        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");

        byte[] hash = factory.generateSecret(spec).getEncoded();

        String res = bytesToHex(hash);
        System.out.println(res);
    }
}

我获得了与数据库中相同的编码凭据(“33D6898C30FBE3E48B9A9EA2D5A0DAD01FD8FD809C9E6A6F3911BB23A481FB0F”)

我获得了有关领域的日志:

juin 10,2021 1:07:14 PM org.apache.catalina.realm.DataSourceRealm open
SEVERE: Exception lors de l'anthentification
java.lang.NullPointerException: Cannot invoke "String.length()" because "n" is null
    at java.naming/javax.naming.NameImpl.<init>(NameImpl.java:283)
    at java.naming/javax.naming.CompositeName.<init>(CompositeName.java:237)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:174)
    at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:385)
    at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:255)
    at org.apache.catalina.authenticator.FormAuthenticator.doAuthenticate(FormAuthenticator.java:244)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:633)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:353)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:870)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1696)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:832)

解决方法

正如 Piotr P. Karwasz 所说,我在 context.xml 和 server.xml 文件中拼错了 dataSourceName。我很遗憾我没有注意到它。

但我还有一个问题:我应该将领域标签放在哪个文档中?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res