title: Why isn't Jersey allowing same rest urls with different HttpMethods?
body: <p>API to get a customer :</p>
  
  <pre><code>@Path("/{customerId}")
  @GET
  @Consumes({"application/json"})
  @Produces({"application/json"})
  </code></pre>
  
  <p>API to update a customer :</p>
  
  <pre><code>@Path("/{customerId}")
  @PUT
  @Consumes({"application/json"})
  @Produces({"application/json"})
  </code></pre>
  
  <p>API to delete a customer :</p>
  
  <pre><code>@Path("/{customerId}")
  @DELETE
  @Consumes({"application/json"})
  @Produces({"application/json"})
  </code></pre>
  
  <p><strong>Note : The same apis in my spring boot project work fine.</strong></p>
  
  <p>In my Java EE application (i don't have much experience working on EE though),
  I am getting weird exceptions when I add these apis :</p>
  
  <pre><code>[#|2019-01-24T18:00:25.698+0530|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=419;_ThreadName=http-thread-pool-8080(3);|WebModule[]StandardWrapper.Throwable
  com.sun.jersey.spi.inject.Errors$ErrorMessagesException
      at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
      at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
      at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at javax.servlet.GenericServlet.init(GenericServlet.java:244)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1453)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1093)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
      at com.sun.grizzly.arp.DefaultAsyncExecutor.execute(DefaultAsyncExecutor.java:159)
      at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:145)
      at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102)
      at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
      at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
      at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
      at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>And</p>
  
  <pre><code>[#|2019-01-24T18:00:25.698+0530|WARNING|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=419;_ThreadName=http-thread-pool-8080(3);|StandardWrapperValve[org.netbeans.rest.application.config.ApplicationConfig]: PWC1382: Allocate exception for servlet org.netbeans.rest.application.config.ApplicationConfig
  com.sun.jersey.spi.inject.Errors$ErrorMessagesException
      at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
      at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
  </code></pre>
  
  <p>Any help/explanation is appreciated.</p>