Problem with access to Tomcat at time of deployment

Asked

Viewed 5,288 times

1

I am working on a Javaee project in Netbeans IDE 8.0.1 using Tomcat 8.0.9 as a container. The problem occurs at the time of project execution, the IDE asks for a user and password and I provide them, but she ignores them and asks again, I click cancel and accuses the following:

Erro de Implantação: O acesso ao servidor Tomcat não foi autorizado. Defina corretamente o nome de usuário e a senha com a atribuição \"manager-script\" no personalizador do Tomcat no gerenciador do servidor.

The problem is that I put the user/password exactly as it is in the server manager and just doesn’t work, I also tried to put the data that are assigned to the manager-script in the archive Tomcat-users.xml and it didn’t work either, another thing I tried was to modify the password in the server manager itself in Netbeans and it didn’t, it continued the same.

How can I solve or at least get around this problem?


I don’t know if this can influence anything, but I installed Tomcat at the time of installing Netbeans (it came bundled with the IDE).

  • Are you using linux? In Ubuntu you can edit the text file that has this configuration, in Windows you should have it too, but then I don’t know where.

  • In fact, I’ve already edited it (Tomcat-users.xml), but it "ignores" this edition and does not accept as user.

  • I edited my answer, I don’t know if you get notification, that one should solve.

3 answers

1

Edit Tomcat-users.xml and add the role "manager-script"

<user username="ide" password="xxx" roles="manager-script,admin"/>
  • I did it, it didn’t work. I also tried to put the same password as the Netbeans manager and it turned out, it doesn’t work.

  • Thank you Luiz Rossi, I was with this same problem and managed to solve with your tip.

0

I had exactly this same problem. I resolved making changes to Tomcat-users.xml Mine was like this:

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
<role rolename="manager-script"/>
<role rolename="admin"/>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="tomcat" roles="manager-script,admin,tomcat,role1, admin-gui"/>
</tomcat-users>

In netbeans, I went to the "Tools" tab under "Servers". I clicked on Tomcat and entered "Tomcat" and "Tomcat" in username and password.

0

I searched for hours for a solution, I was unable to access neither the Web Manager, nor the Server Status nor the Host Manager, until I got here, I used the tip from Mcgbra, I was able to gain access to the Host Manager and Server Status, but the Web Manager was still giving the error 403 access denied. That’s when I added a line to the file and it worked.

Added line: <role rolename="manager-gui"/> and in the roles too roles="manager-script,manager-gui,admin,tomcat,role1, admin-gui"/>

Getting my entire file like this:

<tomcat-users xmlns="http://tomcat.apache.org/xml"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"              version="1.0">
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="tomcat" roles="manager-script,manager-gui,admin,tomcat,role1,admin-gui"/>
</tomcat-users>

Thank you so much for sharing this tip Mcgbra, now it’s working perfectly. Vlw itself!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.