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.
When you're launching tomcat server from netbeans IDE you need to check in menu "tools->servers" on connection tab for tomcat server - there is catalina base directory. And you need to include something like:
at file
or use username automatically generated by IDE with description already placed in this file or on connection tab
For Manager Apps : GUI access:
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
3.. set the same user/pass in IDE tools->server
Source: http://ohmjavaclasses.blogspot.com/2011/12/netbeans-problem-for-apache-tomcat.html
One simple way to check your changes to that file in Tomcat 8 + is to open a browser to: http://localhost:8080/manager/text/list
You will find the tomcat-users.xml in
\Users\<Name>\AppData\Roaming\Netbeans\
. It exists at least twice on your machine, depending on the number of Tomcat installations you have.Well if you are using Netbeans in Linux, then you should look for the tomcat-user.xml in
(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.
restart the server . That's all
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.