title: How to fix access to the requested resource which has been denied in Tomcat?
body: <p>I want to enable form based authentication by using database as realm but I'm always getting that message whenever I try to authenticate as Tomcat manager in Tomcat 6. I have already created a table user_name and user_roles and mapped the username(blue) to admin and manager as role in user_roles table in mysql, but I'm still unable to authenticate. I've already recreated realm tag in <code>server.xml</code> file:</p>
  <pre><code> &lt;Realm className      = &quot;org.apache.catalina.realm.JDBCRealm&quot;
          debug          = &quot;99&quot; 
          driverName     = &quot;com.mysql.jdbc.Driver&quot;
          connectionURL  = &quot;jdbc:mysql://localhost:3306/mail&quot; 
          connectionName = &quot;root&quot; 
          userTable      = &quot;users&quot;
          userNameCol    = &quot;user_name&quot;
          userCredCol    = &quot;user_pass&quot;
          userRoleTable  = &quot;user_roles&quot; 
          roleNameCol    = &quot;role_name&quot; 
   /&gt; 
  </code></pre>
  <p>Could anyone please tell me what's wrong I'm doing, and how I enable form based authentication by using database?</p>
  <ol>
  <li><p>I've declared the user &quot;blue&quot; as both admin and manager, and when I'm trying to login in tomcat manager page, it is giving me the message:</p>
  <blockquote>
  <p>HTTP Status 403 - Access to the requested resource has been denied</p>
  </blockquote>
  </li>
  <li><p>When I enter wrong username or password, tomcat again asks for username and password instead of showing that message.</p>
  </li>
  </ol>