title: How to debug realm feature in Tomcat?
body: <p>I have set the realm setting in server.xml host section to something like this:</p>
  
  <pre><code>&lt;Realm  className="org.apache.catalina.realm.JDBCRealm"  driverName="org.gjt.mm.mysql.Driver"  
           connectionURL="jdbc:mysql://localhost:3306/test" connectionName="test" connectionPassword="test"  
               userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" 
         roleNameCol="user_role" /&gt;
  </code></pre>
  
  <p>Also in web.xml: </p>
  
  <pre><code>&lt;security-role&gt;
      &lt;role-name&gt;ADMIN&lt;/role-name&gt;
  &lt;/security-role&gt;
  
  &lt;security-constraint&gt;  
      &lt;web-resource-collection&gt;  
          &lt;web-resource-name&gt;critical&lt;/web-resource-name&gt;  
          &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;  
          &lt;http-method&gt;GET&lt;/http-method&gt;  
          &lt;http-method&gt;POST&lt;/http-method&gt;  
      &lt;/web-resource-collection&gt;  
      &lt;auth-constraint&gt;  
          &lt;role-name&gt;ADMIN&lt;/role-name&gt;  
      &lt;/auth-constraint&gt;  
  &lt;/security-constraint&gt;  
  
  &lt;login-config&gt;  
      &lt;auth-method&gt;FORM&lt;/auth-method&gt;  
      &lt;form-login-config&gt;  
          &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;  
          &lt;form-error-page&gt;/error.jsp&lt;/form-error-page&gt;  
      &lt;/form-login-config&gt;  
  &lt;/login-config&gt; 
  </code></pre>
  
  <p>And I have the databased set up. However when login.jsp is envoked, even I entered the right password I was redirected to error.jsp</p>
  
  <p>I want to know if there is a way to find what's wrong during the process. Can I do it in Eclipse or any other hints that may solve the problem?</p>