部署错误,访问tomcat未授权错误

时间:2017-07-03 11:34:31

标签: jsp tomcat netbeans

我的tomcat-users.xml文件如下:

<?xml version='1.0' encoding='cp1252'?>
<tomcat-users>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
</tomcat-users>

当我尝试构建项目时,我收到错误:

Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager-script" role in the Tomcat customizer in the Server Manager.
See the server log for details.
BUILD FAILED (total time: 1 second)

在netbeans的服务器窗口中,我提供了相同的用户名和密码。我已经安装了Tomcat 7.0。我不知道这个问题是什么。有什么帮助吗?

1 个答案:

答案 0 :(得分:0)

尝试以下方法:

<?xml version='1.0' encoding='cp1252'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script"/>
</tomcat-users>