title: JAX-RS Jersey Error java.lang.NoSuchMethodError
body: <p>I wanted to implement a file-upload function for my jersey based rest server.</p>
  
  <p>when i set my pom.xml (using maven) to:</p>
  
  <pre><code>    &lt;dependency&gt; 
          &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt; 
          &lt;artifactId&gt;jersey-media-multipart&lt;/artifactId&gt; 
          &lt;version&gt;2.4.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-jdk-http&lt;/artifactId&gt;
          &lt;version&gt;2.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>i get following error:</p>
  
  <pre><code>JAX-RS Jersey Error java.lang.NoSuchMethodError: org.glassfish.jersey.internal.util.ReflectionHelper.getContextClassLoaderPA()Ljava/security/PrivilegedAction;
  </code></pre>
  
  <p>without the "jersey-media-multipart"-dependency the rest server is working but i cant use the file-upload functions.</p>
  
  <p>Following the important part of source code:</p>
  
  <pre><code>ResourceConfig resourceConfig = new ResourceConfig(RestWebServer.class);
  //resourceConfig.register(MultiPartFeature.class);
  URI endPoint = new URI(pathServer);
  
  server = JdkHttpServerFactory.createHttpServer( endPoint, resourceConfig );
  </code></pre>
  
  <p>RestWebserver.java:</p>
  
  <pre><code>@Path("/fileupload")
  @POST
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  public Response uploadFile( 
          @FormParam("file") InputStream uploadedInputStream, 
          @FormParam("file") FormDataContentDisposition fileDetail) 
  {
      String uploadedFileLocation = "c://" + fileDetail.getFileName();
  
      // save it
      saveToFile(uploadedInputStream, uploadedFileLocation);
  
      String output = "File uploaded via Jersey based RESTFul Webservice to: " + uploadedFileLocation;
  
      return Response.status(200).entity(output).build();
  }
  </code></pre>