Tomcat 9无法登录manager / html

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

        <user username="tomcat" password="" roles="tomcat"/> <user username="both" password="" roles="tomcat,role1"/> <user username="role1" password="" roles="role1"/>  

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

您的所有权限都是正确的,您添加的新用户也没问题。 问题是您没有在这三个预先配置的用户上设置有效密码:

     

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) 

错误消息非常明确:

 The value of attribute "password" associated with an element type "user" must not contain the '<' character. 

只需用"password"替换""每个实例,然后重新启动Tomcat以解决问题。