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

Eric Wilson picture Eric Wilson · Aug 24, 2009 · Viewed 291.8k times · Source

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.

Answer

user162663 picture user162663 · Aug 25, 2009

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:

 <role rolename="manager"/>
  <user username="admin" password="admin" roles="manager"/>

at file

\CATALINA_BASE\conf\tomcat-users.xml

or use username automatically generated by IDE with description already placed in this file or on connection tab

For Manager Apps : GUI access:

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>