title: 'Not it is a servlet specified in web.xml' error in Netbeans
body: <p>I have made a simple Servlet which is accessing a POJO object method in Netbeans.I have added Servlet details in web.xml also but on running the servlet class it is giving error </p>
  
  <pre><code>neither a main nor it is a servlet specified in web.xml
  </code></pre>
  
  <p>Here is my servlet class code..</p>
  
  <pre><code>public  class Service extends HttpServlet {
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
          try {
              BLC blc = new BLC();
              blc.captureCDRProcess();
          } catch (Exception ex) {
              System.out.println(ex);
          }
    } 
  }
  </code></pre>
  
  <p>And here is my Web.xml Code..</p>
  
  <pre><code> &lt;servlet&gt;
      &lt;servlet-name&gt;Service&lt;/servlet-name&gt;
      &lt;servlet-class&gt;pojoserv.Service&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Service&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Service&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  </code></pre>