title: How to deliver Realm with the war with Tomcat?
body: <p>we have a simple web application running on Tomcat 7.0.56. Now we want to use our 
  own realm for authentication.</p>
  
  <pre><code>public class SpecialAuth extends DataSourceRealm{
      @Override
      public Principal authenticate(String username, String credentials){
          ....
      }
  }
  </code></pre>
  
  <p>This is defined in the /META-INF/context.xml inside the war</p>
  
  <pre><code>&lt;Context&gt;
      &lt;Realm className="some.package.SpecialAuth" dataSourceName="jdbc/MySQL" /&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p><strong>Where to put the SpecialAuth.class?</strong></p>
  
  <p>What we expected was simply to have the SpecialAuth.class inside our war but then we're getting folling exception on startup</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: some.package.BackOfficeAuth
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      ....
  </code></pre>
  
  <p>If we make a jar, putting it into $TOMCAT/lib everything works fine. </p>
  
  <p>But this CAN'T be the solution! That would mean every time I work on this class(es) I have to touch my tomcat server and can't use the normal deployment.</p>
  
  <p>How can I use the build-in authentication mechanism without touching the tomcat all the timeß</p>