Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:01:55+00:00 2026-06-11T03:01:55+00:00

I am using Jersey to upload file. I defined the method: @POST @Path(/upload) @Consumes(multipart/form-data)

  • 0

I am using Jersey to upload file.
I defined the method:

@POST
@Path("/upload")
@Consumes("multipart/form-data")
public Collection<Message> uploadImage(@FormDataParam("file") InputStream uploadedInputStream,
            @FormDataParam("file") FormDataContentDisposition fileDetail) throws IOException {
}

And invoke the call from Jersey Client for testing:

ClientConfig cc = new DefaultClientConfig();
cc.getClasses().add(MultiPartWriter.class);
Client client = Client.create(cc);
String url = "http://localhost:8080/API/api/images/upload/150";
File f = new File("C:/Pictures/1360_435x300.jpg");
FormDataMultiPart form = new FormDataMultiPart();
form.bodyPart(new FileDataBodyPart("thumbnail", f));
String s = client.resource(url).type(MediaType.MULTIPART_FORM_DATA).accept(MediaType.APPLICATION_JSON).post(String.class, form);

However, I get:

SEVERE: Missing dependency for method public java.util.Collection
ImageResource.uploadImage(java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition)
throws java.io.IOException at parameter at index 1

what is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:01:57+00:00Added an answer on June 11, 2026 at 3:01 am

    Make sure all libs are the same version (e.g. 1.13), and don’t forget to add mimepull.jar and jersey-multipart.jar as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Jersey to send HTTP POST requests like this: MultivaluedMap<String, String> form =
I'm trying to upload a file using JavaFX using the HttpRequest. For this purpose
Using Jersey 1.7, JAX-WS 2.2.3, Tomcat 6.0.30 and the following method declaration prevents Jersey
I'm using Jersey 1.11 and trying to model both POST and DELETE methods in
I am using jersey, and I want to send (in a POST) a list
I am using Jersey for Rest and have a method that accepts @QueryParam. However,
I am using Jersey client for http-based request. It works well if the file
I am building a webservices application using jersey,jax-rs I have single jax-rs resource file
Using Jersey, I want to be able to have a GET request, that would
I am using Jersey (with Jetty) and Maven to implement a RESTful service. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.