Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Tomcat 9 can';t登录到manager/html_Java_Tomcat_Servlets_Jakarta Ee_Tomcat9 - Fatal编程技术网

Java Tomcat 9 can';t登录到manager/html

Java Tomcat 9 can';t登录到manager/html,java,tomcat,servlets,jakarta-ee,tomcat9,Java,Tomcat,Servlets,Jakarta Ee,Tomcat9,我不确定为什么无法登录,以下是权限: <tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"&

我不确定为什么无法登录,以下是权限:

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  application.
-->
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <role rolename="manager-script"/>
  <user username="lamidotijjo" password="s3cr3t" roles="manager-gui,manager-script,admin-gui"/>
  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>

</tomcat-users>


昨天,我在Ubuntu的tomcat官方网站上安装了它。我认为所有的权限都是正确的。谢谢

您的所有权限都是正确的,您添加的新用户也可以。问题是您没有在文件tomcat users.xml中为这三个预先配置的用户设置有效密码:

  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>

Tomcat故意用无效密码配置这些用户,迫使您将其更改为有效密码。如果在使用这些设置启动Tomcat后检查日志,您可能会看到几个类似的堆栈跟踪:

10-Jun-2018 00:04:35.343 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 902 ms
10-Jun-2018 00:04:35.386 SEVERE [main] org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at line 48 column 34: The value of attribute "password" associated with an element type "user" must not contain the '<' character.
 org.xml.sax.SAXParseException; lineNumber: 48; columnNumber: 34; The value of attribute "password" associated with an element type "user" must not contain the '<' character.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
10-Jun-2018 00:04:35.343 INFO[main]org.apache.catalina.startup.catalina.load初始化处理时间为902毫秒

2018年6月10日00:04:35.386严重[main]org.apache.tomcat.util.digester.digester.fatalError第48行第34列解析致命错误:与元素类型“user”关联的属性“password”的值不得包含“请告诉我们“无法登录”的详细信息”?
The value of attribute "password" associated with an element type "user" must not contain the '<' character.