users@jersey.java.net

[Jersey] Re: SEVERE: A message body reader for Java class com.sun.jersey.multipart.FormDataMultiPart, and Java type class com.sun.jersey.multipart.FormDataMultiPart, and MIME media type multipart/form-data; boundary=Boundary_1_12258573_127987272668 was not found

From: Stephan Knull <stephan.knull_at_ppimedia.de>
Date: Tue, 3 May 2011 01:00:22 -0700 (PDT)

Hello,

I have a similar problem with version 1.6. I previously used the following
codes with version 1.1.5 which worked fine for me:

Here is the client side code:

      final WebResource resource =
IntranetUtil.getJerseyClient().resource(baseUrl + "/theService");
      FormDataMultiPart formData;
      formData = new FormDataMultiPart();
      formData.field("schema", "THESCHEMA", MediaType.TEXT_PLAIN_TYPE);
      formData.field("table", "THETABLE", MediaType.TEXT_PLAIN_TYPE);
      formData.field("authUser", "THEUSER", MediaType.TEXT_PLAIN_TYPE);
      final String result =
resource.type("multipart/form-data").post(String.class, formData);
      formData.close();
      return result;

And her the server side:

  @POST
  @Path("theService")
  @Consumes("multipart/form-data")
  public String theService(
                  @DefaultValue("") @FormParam("schema") final String schema,
      @DefaultValue("") @FormParam("table") final String table,
      @DefaultValue("") @FormParam("authUser") final String authUser)
      throws Exception
  {
                ...
  }

In my "theService" method I could use the parameters "schema", "table", etc.
directly as usual.
After switching to version 1.6 I have the problem, that on the server side
all form fields are empty/not set now. I had to roll back to version 1.1.5
for now since this was production code.
How can I fix this (ofcourse I don't want to stay with that very old
version)?

Kind regards
Stephan Knull

--
View this message in context: http://jersey.576304.n2.nabble.com/SEVERE-A-message-body-reader-for-Java-class-com-sun-jersey-multipart-FormDataMultiPart-and-Java-typed-tp5969276p6326476.html
Sent from the Jersey mailing list archive at Nabble.com.