为什么我得到部署错误?

sap*_*Pro 4 java tomcat netbeans web-applications java-ee

当我尝试从netbeans部署我的Web应用程序时,出现以下错误:

Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
W:\UnderTest\NetbeansCurrent\WebApplication1\nbproject\build-impl.xml:1033: 
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: 14 seconds)
Run Code Online (Sandbox Code Playgroud)

那是什么 ?为什么我收到此错误?

以下是来自以下内容的片段 tomcat-users.xml:

    <tomcat-users>
<!--
  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.
-->
<!--
  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"/>
  <role rolename="manager-gui"/>
  <user username="suhail" password="suhail" roles="manager-gui"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>

</tomcat-users>
Run Code Online (Sandbox Code Playgroud)

以下是netbeans服务器设置的快照:

在此输入图像描述

MaV*_*SCy 5

您必须添加manager-script以执行部署操作.

所以在你xml你应该有类似的东西

<user username="suhail" password="suhail" roles="manager-gui,manager-script"/>
Run Code Online (Sandbox Code Playgroud)