4

Web アプリケーションを netbeans からデプロイしようとすると、次のエラーが発生します。

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)

それは何ですか ?なぜこのエラーが発生するのですか?

からのスニペットを次に示し 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>

以下は、netbeans サーバー設定のスナップショットです。

ここに画像の説明を入力

4

1 に答える 1

5

manager-script展開操作を実行するには、 を追加する必要があります。

したがって、xmlには次のようなものが必要です

<user username="suhail" password="suhail" roles="manager-gui,manager-script"/>
于 2013-05-23T11:42:40.723 に答える