title: Why can't I call this simple web service?
body: <p>I have created a web project on Eclipse with one class: "HelloWorld.java", that it's supposed to have a method that answers GET requests.</p>
  
  <pre><code>package javaeetutorial.hello;
  
  // imports
  
  @Path("base")
  public class HelloWorld extends HttpServlet {
  
      public HelloWorld() {
      }
  
      @GET
      @Produces("text/html")
      public String getHtml() {
          return "&lt;html lang=\"en\"&gt;&lt;body&gt;&lt;h1&gt;Hello, World!!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;";
      }
  }
  </code></pre>
  
  <p>Then, in the WebContent folder, in the WEB-INF directory, I have created a web.xml file with the following content in order to map requests to the /hello url to my servlet.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
           metadata-complete="true"
           version="3.1"&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javaeetutorial.hello.HelloWorld&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/hello&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I export the project to a .war file and then I deploy it with Glassfish, but when I call the URL that supposedly calls my web service it shows me "The requested resource () is not available".</p>
  
  <p>The URL I am calling is: <a href="http://localhost:8080/Calculator/hello/base" rel="nofollow noreferrer">http://localhost:8080/Calculator/hello/base</a></p>
  
  <p>Why is my web service not being called?</p>