title: NoSuchMethodError javax.ws.rs.core.Application.getProperties()Ljava/util/Map
body: <p>I am trying my first REST application.</p>
  
  <p>Below is my configuration:</p>
  
  <ul>
  <li>Java 7</li>
  <li>JBoss AS 7.1</li>
  <li>Jersey 2.22.2</li>
  </ul>
  
  <p>Below are list of jars downloaded by Maven:</p>
  
  <p><a href="https://i.stack.imgur.com/C9Vks.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C9Vks.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0    http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;org.prasad&lt;/groupId&gt;
  &lt;artifactId&gt;messenger&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;messenger&lt;/name&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;messenger&lt;/finalName&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
              &lt;inherited&gt;true&lt;/inherited&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &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.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
          &lt;!-- use the following artifactId if you don't need servlet 2.x compatibility --&gt;
          &lt;!-- artifactId&gt;jersey-container-servlet&lt;/artifactId --&gt;
          &lt;exclusions&gt;
  &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;!-- uncomment this to get JSON support
      &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;
      --&gt;
  &lt;/dependencies&gt;
  &lt;properties&gt;
      &lt;jersey.version&gt;2.22.2&lt;/jersey.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p></p>
  
  <p>On server starting, I am getting the below exception:</p>
  
  <pre><code>21:14:29,013 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/messenger]] (MSC service thread 1-1) StandardWrapper.Throwable: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
      at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:331) [jersey-server-2.22.2.jar:]
      at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392) [jersey-container-servlet-core-2.22.2.jar:]
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) [jersey-container-servlet-core-2.22.2.jar:]
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) [jersey-container-servlet-core-2.22.2.jar:]
      at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
  </code></pre>
  
  <p>According to the logs above <code>ApplicationHandler.init()</code> method is calling <code>Application.getProperties()</code>.</p>
  
  <p><code>ApplicationHandler</code> is in <em>jersey-server-2.22.2.jar</em> and <code>Application</code> is in <em>javax.ws.rs-api-2.0.1</em>, both jars are present in build path.</p>
  
  <p>But still I am getting <code>NoSuchMethodError</code>. I have checked below links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/28509370/nosuchmethoderror-on-startup-in-java-jersey-app">link 1</a> I am not using swagger at all;</li>
  <li><a href="https://stackoverflow.com/questions/19225618/java-restfull-webservice-jax-rs-implementation-with-jersey-2-3-1-libraries">link 2</a> I couldn't see more than one version of <code>Application</code> class;</li>
  <li><a href="https://stackoverflow.com/questions/30723370/java-lang-nosuchmethoderror-javax-ws-rs-core-application-getpropertiesljava-u">link 3</a> I am using JRE 7 and JBoss AS 7.1 is also JDK 7 compatible.</li>
  </ul>
  
  <p>So I have only one <a href="http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Application.html" rel="nofollow noreferrer">Application</a> which contains <code>getProperties()</code> method and even then I am getting <code>NoSuchMethodError</code>. Can any one please give me reason why this is happening?</p>