title: How to rectify the following error while using Servlet?
body: <p>I am learning Servlets concept. Initially, I <a href="https://stackoverflow.com/tags/servlets/info">Tutorial</a> referred to this link and working on the HelloWorld example.</p>
  
  <p>On submission of the JSP form with the name and age I get the following errors. Kindly advise on what has to be done.</p>
  
  <p>The locations of my files placed are as follows,</p>
  
  <p>C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servletexmple\hello.jsp</p>
  
  <p>C:\Program Files\Apache Software Foundation\Tomcat5.5\webapps\servletexmple\example\HelloServlet.class   </p>
  
  <p>C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servletexmple\WEB-INF\web.xml</p>
  
  <pre><code>Exception:
  
  javax.servlet.ServletException: Wrapper cannot find servlet class example.HelloServlet or a class it depends on
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
  org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
  java.lang.Thread.run(Unknown Source)
  
  Root Cause:
  java.lang.ClassNotFoundException: example.HelloServlet
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
  org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>My web.xml file contains as follows,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  id="WebApp_ID" version="2.5"&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;example.HelloServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/servletexmple&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>