Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.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管理器_Java_Tomcat - Fatal编程技术网

Java 无法登录到Tomcat管理器

Java 无法登录到Tomcat管理器,java,tomcat,Java,Tomcat,我没有我的tomcat经理的任何凭证。一切都有评论。当我运行时,它要求输入用户名和密码。当我尝试在没有他们的情况下登录时,它仍然不起作用。我无法编辑该文件,无法取消注释 下面是tomcat-users.xml <?xml version='1.0' encoding='cp1252'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agre

我没有我的tomcat经理的任何凭证。一切都有评论。当我运行时,它要求输入用户名和密码。当我尝试在没有他们的情况下登录时,它仍然不起作用。我无法编辑该文件,无法取消注释

下面是tomcat-users.xml

<?xml version='1.0' encoding='cp1252'?>
<!--
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.
 -->
 <tomcat-users>
 <!--
NOTE:  By default, no user is included in the "manager-gui" role required
t o 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.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
<!--
 <role rolename="tomcat"/>
 <role rolename="role1"/>
 <user username="tomcat" password="tomcat" roles="tomcat"/>
 <user username="both" password="tomcat" roles="tomcat,role1"/>
 <user username="role1" password="tomcat" roles="role1"/>
-->


我甚至不认为以管理员身份运行可以在括号中打开。我该怎么办?

您需要取消注释所述xml中的
用户
角色
条目,以启用登录用户

这个条目应该可以让你走了-

我认为这是不言而喻的,您需要在
Tomcat
home dir上拥有
write
权限


注意:别忘了重新启动服务器

我知道要取消注释。但是,如果它是一个*nix mahince,我无法在取消注释try
sudo
后保存它。例如,
sudo-vim-tomcat-users.xml
我正在使用windows。Sudo只用于Linux版本,对吗?是的。您需要对文件具有
写入
访问权限。在安全设置下,我无法更改任何写入权限。它在C驱动器中(