title: java.lang.NoSuchMethodError: getProperties()Ljava/util/Map;
body: <p>I'm creating a REST API using Jersey. On my local machine, I was running Apache Tomcat 8 with maven. When I run my eclipse on my local machine, it works fine. However, when I tried to build via Jenkins on my remote server (I'm pushing my changes to the remote server and let it build there), I'm getting the following error</p>
  
  <pre><code>java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
  org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:331)
  org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:390)
  org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:172)
  org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:364)
  javax.servlet.GenericServlet.init(GenericServlet.java:158)
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
  org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
  java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Here is my pom.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.jersey&lt;/groupId&gt;
                  &lt;artifactId&gt;jersey-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jersey.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.dataformat&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-dataformat-xml&lt;/artifactId&gt;
              &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
              &lt;artifactId&gt;mongodb-driver&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;jersey.version&gt;2.22.1&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  </code></pre>
  
  <p>I've searched online and it says it has something to do with Jerser v1 and v2 conflicting with each other. My local machine and remote machine has the same source code, same JDKs but when deployed, the remote machine throws that error when the endpoint is hit. What might go wrong</p>