title: NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll
body: <p>I am developing a dynamic web application in Java (1.8) based on Jersey and using Maven to define dependencies. I am working in Eclipse Oxygen using Tomcat 9.  I am new at both web-application development and Maven so I am struggling to understand how to get things working.  </p>
  
  <p>When I run the application, it fails with the error shown below.  I have read several articles.  This error is apparently due to a mismatch between the compile time environment and the run time environment. </p>
  
  <p>I have tried changing the versions of various components hoping to find the right combination, but have not succeeded. I also have tried deleting the .m2/repository and running Maven/Update Project to refresh the environment, but this has not helped.   Perhaps someone with more experience can spot the source of the incompatibility in my pom.xml file.</p>
  
  <pre><code>java.lang.NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)V
      at org.glassfish.jersey.client.ClientRequest.accept(ClientRequest.java:335)
      at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:222)
      at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:60)
      at com.simfinit.client.SimDcmClient.get(SimDcmClient.java:36)
      at com.simfinit.client.SimDcmClientTest.testGetList(SimDcmClientTest.java:19)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
  </code></pre>
  
  <p>Here is my pom.xml file:</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;com.simfinit.resources&lt;/groupId&gt;
      &lt;artifactId&gt;SimWebServiceDcm&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;SimWebServiceDcm&lt;/name&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;SimWebServiceDcm&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;3.7.0&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&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;javax.ws.rs&lt;/groupId&gt;
              &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&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;!-- use the following artifactId if you don't need servlet 2.x compatibility --&gt;
              &lt;!-- artifactId&gt;jersey-container-servlet&lt;/artifactId --&gt;
          &lt;/dependency&gt;
          &lt;!-- uncomment this to get JSON support --&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;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
              &lt;version&gt;8.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-common&lt;/artifactId&gt;
              &lt;version&gt;${jersey.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  &lt;!--        &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
              &lt;version&gt;${jersey.version}&lt;/version&gt;
          &lt;/dependency&gt;
   --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.simfinit&lt;/groupId&gt;
              &lt;artifactId&gt;SimService&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.simfinit&lt;/groupId&gt;
              &lt;artifactId&gt;SimCommunication&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.simfinit&lt;/groupId&gt;
              &lt;artifactId&gt;SimServiceDcm&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.simfinit&lt;/groupId&gt;
              &lt;artifactId&gt;SimBase&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;jersey.version&gt;2.26&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I tried using "mvn dependency:tree" to identify possible conflicts.  This command returned an error:</p>
  
  <pre><code>[ERROR] No plugin found for prefix 'dependency' in the current project and in the plugin groups...
  </code></pre>
  
  <p>I read the help article and other articles that suggested deleting the .m2/repository folder and repeating the mvn command.  There result is shown below. Are these errors an indication that I have supplied an incorrect version number in the pom file?  I suppose this information is supposed to help me, but I don't know what the next step should be.  The content of my pom came from other articles, but may be valid only for certain versions.  I have been adding and substituting pom dependencies without really knowing how to determine compatibility of the changes.</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.758 s
  [INFO] Finished at: 2018-05-17T14:56:56-07:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] No plugin found for prefix 'help' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\Kent\.m2\repository), central (https://repo.maven.apache.org/maven2)] -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
  
  E:\GitRepositories\simfiniclient\SimWebServiceDcm&gt;mvn help:active-profiles
  [INFO] Scanning for projects...
  Downloading from central: https://repo.maven.apache.org/maven2/org/glassfish/jersey/jersey-bom/2.26/jersey-bom-2.26.pom
  [ERROR] [ERROR] Some problems were encountered while processing the POMs:
  [ERROR] Non-resolvable import POM: Could not transfer artifact org.glassfish.jersey:jersey-bom:pom:2.26 from/to central (https://repo.maven.apache.org/maven2): Permission denied: connect @ line 31, column 16
  [ERROR] 'dependencies.dependency.version' for org.glassfish.jersey.containers:jersey-container-servlet-core:jar is missing. @ line 47, column 15
  [ERROR] 'dependencies.dependency.version' for org.glassfish.jersey.media:jersey-media-moxy:jar is missing. @ line 54, column 15
   @
  [ERROR] The build could not read 1 project -&gt; [Help 1]
  [ERROR]
  [ERROR]   The project com.simfinit.resources:SimWebServiceDcm:1.0-SNAPSHOT (E:\GitRepositories\simfiniclient\SimWebServiceDcm\pom.xml) has 3 errors
  [ERROR]     Non-resolvable import POM: Could not transfer artifact org.glassfish.jersey:jersey-bom:pom:2.26 from/to central (https://repo.maven.apache.org/maven2): Permission denied: connect @ line 31, column 16 -&gt; [Help 2]
  [ERROR]     'dependencies.dependency.version' for org.glassfish.jersey.containers:jersey-container-servlet-core:jar is missing. @ line 47, column 15
  [ERROR]     'dependencies.dependency.version' for org.glassfish.jersey.media:jersey-media-moxy:jar is missing. @ line 54, column 15
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
  [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
  </code></pre>