Http method GET shows error when using jersey
<p>I am following a tutorial to learn REST api. Below is my code that has GET annotation and use Weblogic server to deploy my application. For some reason it is showing the following error:</p>

<pre><code>HTTP method GET is not supported by this URL
</code></pre>

<p>Sample.java</p>

<pre><code>import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("/v1")
public class V1_status {
    @GET
    @Produces(MediaType.TEXT_HTML)
    public String returnTitle(){
        return "&lt;p&gt; Yess &lt;/p&gt;";
    }
}
</code></pre>

<p>web.xml</p>

<pre class="lang-html prettyprint-override"><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_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
  &lt;display-name&gt;com.glasschecker.rest&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;

  &lt;servlet&gt;
    &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
      &lt;param-value&gt;com.glasschecker.rest&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/api/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;

  &lt;/web-app&gt;
</code></pre>



<p>This is the tutorial:</p>

<blockquote>
  <p><a href="https://www.youtube.com/watch?v=4DY46f-LZ0M&amp;list=PLu47tUtKqNlwfR-" rel="nofollow">https://www.youtube.com/watch?v=4DY46f-LZ0M&amp;list=PLu47tUtKqNlwfR-</a>
  nqjiWUaIWOYEi9FyW0&amp;index=2</p>
</blockquote>

<p>I use the following URL <a href="http://localhost:7001/com.glasschecker.rest/api/v1" rel="nofollow">http://localhost:7001/com.glasschecker.rest/api/v1</a> the URL pattern is added to the Servlet.</p>

<p>When I try to access <a href="http://localhost:7001/com.glasschecker.rest" rel="nofollow">http://localhost:7001/com.glasschecker.rest</a> it shows the index.html file properly (first file in my web.xml). I am sure something in my file.</p>

<p><strong>NOTE the java class is inside this package:</strong></p>

<p><strong>com.glasschecker.rest.status</strong></p>

<p>This is the error i am getting:</p>

<pre><code>weblogic.application.ModuleException: weblogic.management.DeploymentException: [HTTP:101170]The servlet org.foo.rest.MyApplication is referenced in servlet-mapping /api but not defined in web.xml.
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:237)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:232)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: weblogic.management.DeploymentException: [HTTP:101170]The servlet org.foo.rest.MyApplication is referenced in servlet-mapping /api but not defined in web.xml.
    at weblogic.servlet.internal.WebAppServletContext.verifyServletMappings(WebAppServletContext.java:1566)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3066)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1830)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:875)
    at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
</code></pre>