Http status 500 Error instantiating servlet class
<p>I'm using Tomcat8 server and i'm getting following error.</p>

<p><a href="https://i.stack.imgur.com/7XZaz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7XZaz.png" alt="After deployment"></a></p>

<p><a href="https://i.stack.imgur.com/dZwbJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dZwbJ.png" alt="Project Explorer"></a></p>

<p>It's url is <code>http://localhost:8080/WeatherWebApp</code> When i'm submitting the details then it's giving this error.
Here is WeatherServlet.java class</p>

<pre><code>package org.akshayrahar;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WeatherServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    WeatherServlet(){

    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("again");
        response.setContentType("text/html");
        PrintWriter out=response.getWriter();
        out.println("akshay rahar");
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }

}
</code></pre>

<p>Here is web.xml file</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE xml&gt;
&lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee"&gt;
  &lt;display-name&gt;WeatherWebApp&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;

  &lt;servlet&gt;
        &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;WeatherServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/CurrentWeather&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;
</code></pre>

<p>Here is index.html file too:-</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Weather App&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" href="stylesheet.css"&gt;
        &lt;script &gt;
      function initMap() {
        var input =document.getElementById('pac-input');

        var autocomplete = new google.maps.places.Autocomplete(input);
      }
    &lt;/script&gt;
    &lt;script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyACZhmkSaIz436Dt3kHt_cVEYKN-gHzfYo&amp;libraries=places&amp;callback=initMap"async defer&gt;&lt;/script&gt;
    &lt;/head&gt;


    &lt;body&gt;
        &lt;h1&gt;Find weather of any city in the world&lt;/h1&gt;
        &lt;h2&gt;Enter City Name&lt;/h2&gt;

        &lt;form  id="form" action="CurrentWeather" method="GET"&gt;
        &lt;input id="pac-input" type="text" name="cityname"&gt;
        &lt;/form&gt;&lt;br&gt;

        &lt;div class="button1"&gt;
        &lt;button type="submit" form="form" value="Submit"&gt;Submit&lt;/button&gt;
        &lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I've also mentioned stylesheet.css file in comment. Please check it.</p>