title: SEVERE: Allocate exception for servlet <myservlet-name> java.lang.ClassNotFoundException: <myservlet> exception
body: <p>When I use the following <code>web.xml</code>, my project runs fine and I can see "Hello World" getting displayed via index.jsp page. I am using <strong>Netbeans 7.4</strong> and <strong>Apache tomcat 6.0.41</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
   &lt;/web-app&gt;
  </code></pre>
  
  <p>However, when I created my own servlet and use the following <code>web.xml</code>,=</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
  
   &lt;servlet&gt;
      &lt;servlet-name&gt;TEST_Authenticate&lt;/servlet-name&gt;
      &lt;servlet-class&gt;restapi.TEST_Authenticate&lt;/servlet-class&gt;
  &lt;/servlet&gt;  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;TEST_Authenticate&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/TEST_Authenticate&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
      &lt;version&gt;3.0.1&lt;/version&gt;
  
  
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p></p>
  
  <p>I end up getting the following error in the Apache Tomcat Log:</p>
  
  <pre><code>Jul 24, 2014 9:36:14 AM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Allocate exception for servlet TEST_Authenticate
  java.lang.ClassNotFoundException: TEST_Authenticate
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>I have checked the following <a href="https://stackoverflow.com/questions/17982240/java-lang-classnotfoundexception-for-servlet-in-tomcat-with-eclipse">post</a> but still getting the errors.</p>
  
  <p><strong>Project Structure :</strong></p>
  
  <p><img src="https://i.stack.imgur.com/JivIs.jpg" alt="enter image description here"></p>