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

77,504

Solution 1

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?

Solution 2

same problem.. fixéd it by adding:

<tomcat-users> <role rolename="manager-script"/> <user username="user" password="user" roles="manager-script"/> </tomcat-users>

to C:\Program files\apache-tomcat-7.0.47\conf\tomcat-users.xml

and remember to run netbeans as administrator.

Solution 3

Hello the solution is the below :

  1. remove netbeans and tomcat
  2. remove the cash directory c:\users{youruser}.netbeans\
  3. remove the netbeans folder in : C:\Users{youruser}\AppData\Roaming\netbeans
  4. re-install netbeans and tomcat
  5. add your application i will works

tested !! :D

Solution 4

I also got this error. I've solve with this. I've got this error becasue user I log on to computer is not have permission to get access C: and can't add user info in .\conf\tomcat-users.xml. So I've copy tomcat folders to D: and remove and add again tomcat server in my NetBeans and start server again.. Now I'm fine.

Solution 5

Go to C:\Users\ur folder\AppData\Roaming\NetBeans\8.0.2\apache-tomcat-8.0.15.0_base\conf\tomcat-users.xmland delete the line

<user password="admin" roles="manager-script,admin" username="admin"/> `

within the tomcat users tab.

remove the apache tomcat server from netbeans and add it again setting catalina home to C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\conf\Catalina\localhost\conf\Catalina\localhost and create a new user. Then it will be fixed

Share:
77,504
capdragon
Author by

capdragon

Updated on December 26, 2021

Comments

  • capdragon
    capdragon over 2 years

    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?

    • Mark Thomas
      Mark Thomas over 10 years
      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?
    • capdragon
      capdragon over 10 years
      @MarkThomas Please enter your comment as an answer so I can give you credit. I went through your steps... Manager I think was deploying but I couldnt' authenticate. I decided to place back in the original web.xml and server.xml and try again. It worked. So something that was changed was messing me up. But your Step 2 or 4 fixed it, thanks!
    • Mark Thomas
      Mark Thomas over 10 years
      Done as request. Thanks in advance.
    • sampathlk
      sampathlk about 10 years
  • martinweberhansen
    martinweberhansen over 8 years
    the "user" in password and username i used the same credentials as in netBeans.. find it by opening services, right click on servers, open properties and you should find the credentials there.
  • Noby Nirmal
    Noby Nirmal about 8 years
    I mean remove the line <user password="admin" roles="manager-script,admin" username="admin"/>