tomcatnetbeanstomcat7netbeans-7

Set the correct username and password with the "manager-script" role in the Tomcat


I know this has been asked many before. But I have already placed my user to role "manager-script".

I keep getting this when trying to deploy:

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.

enter image description here

My D:\DEV\apache-tomcat-7.0.47\conf\tomcat-users.xml:

<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
    <role rolename="manager-script"/>
    <user username="user" password="user" roles="manager-script"/>
</tomcat-users>

The server starts just fine without errors from netbeans but when I go to deploy, it keep asking me for the credentials that has "manager-script".

enter image description here

What I have tried:

  1. Removing all other Apache installs/directories.
  2. Rebooting.
  3. Double, triple and quadruple checking the username and password (user@user).

What am I doing wrong?


Solution

  • Short answer - don't know. Your tomcat-users.xml looks right. Things to check:

    1. Is the Manager app deployed?
    2. Has the web.xml used by the Manager (where manager-script is used) been changed?
    3. Use JMX to confirm that the users and roles are read correctly.
    4. Has the Realm been changed in server.xml?