How do I set Tomcat Manager Application User Name and Password for NetBeans?

309,333

Solution 1

Netbeans Problem: For apache Tomcat server Authentication required dialog box requesting user name and password

This dialog box appear If a user role and his credentials are not set or is incorrect for Tomcat startup via NetBeans IDE,

OR when user/pass set in IDE is not matches with user/pass in "canf/tomcat-user.xml" file

1..Need to check user name and password set in IDE tools-->server

2..Check \CATALINA_BASE\conf\tomcat-users.xml. whether user and his role is defined or not. If not add these lines

<user username="ide" password="EiWnNlBG" roles="manager-script,admin"/>
</tomcat-users>

3.. set the same user/pass in IDE tools->server

  1. restart your server to get effect of changes

Source: http://ohmjavaclasses.blogspot.com/2011/12/netbeans-problem-for-apache-tomcat.html

Solution 2

I case of tomcat 7 the role has changed from manager to manager-gui so set it as below in the tomcat-user.xml file.

enter image description here

Solution 3

Well if you are using Netbeans in Linux, then you should look for the tomcat-user.xml in

/home/Username/.netbeans/8.0/apache-tomcat-8.0.3.0_base/conf

(its called Catalina Base and is often hidden) instead of the Apache installation directory.

open tomcat-user.xml inside that folder, uncomment the user and roles and add/replace the following line.

    <user username="tomcat" password="tomcat" roles="tomcat,admin,admin-gui,manager,manager-gui"/>

restart the server . That's all

Solution 4

Follow my steps and be happy:

1.- When you are configuring Netbeans for the first time, they will ask you for a "user" and "pass" for the Catalina-Server.

2.- Type whatever "user" and "pass" . This will modify your "tomcat-users.xml" and will add:

user password="MYPASS" roles="manager-script,admin,tomcat" username="MYUSER"

3.- To use this "user" just restart your TOMCAT WEB SERVER and NETBEANS.

Solution 5

File \conf\tomcat-users.xml, before this line

</tomcat-users>

add these lines

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>   
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
Share:
309,333
Eric Wilson
Author by

Eric Wilson

Software developer, experienced in Java and Python in Linux environments, formerly a professor of mathematics. I'm a father of five children, and a husband of one wife.

Updated on July 30, 2020

Comments

  • Eric Wilson
    Eric Wilson almost 4 years

    I'm trying to follow a tutorial to make an extremely basic Java web application in NetBeans.

    When I try to run it, a dialogue box appears title "Authentication Required". Inside the dialogue box there the heading "Tomcat Manager Application" and fields for "User Name" and "Password."

    Investigating this, I've come to understand that I should edit the file

    \TOMCAT_HOME\conf\tomcat-users.xml
    

    to include something like:

    <user username="user" password="password" roles="standard,manager"/>
    

    so I've done that, but it hasn't helped yet.

    Can anyone provide some insight? I'm using Tomcat 6.0.20, NetBeans 6.7.1, and Windows Vista. I'm using jdk1.7.0, but Java hasn't really entered into this project yet.

  • Eric Wilson
    Eric Wilson over 12 years
    I hope your answer is useful for someone. As for me, I'm not using NetBeans these days, and I have no real guess how I might have resolved this problem from over two years ago. So I'll not be able to evaluate your answer and determine if it merits an upvote.
  • Eric Wilson
    Eric Wilson over 10 years
    Hope this helps someone. This may be the first answer I've received on a question that was 4 years old.
  • Eric Wilson
    Eric Wilson almost 10 years
    Thanks. I recommend that if you choose to answer questions posted nearly 5 years ago, you explain what it is that your answer provides that the existing answers lack.
  • will
    will about 8 years
    Tomcat8 also used these roles, see: Configuring Manager application access. Netbeans is looking for the manager-script role - Server / Tomcat Properties dialogue.
  • DoesEatOats
    DoesEatOats over 7 years
    I would add to test open your browser to this url:
  • user207421
    user207421 almost 6 years
    Don't post pictures of text here. Post the text. Waste of your time and our bandwidth.