users@jersey.java.net

Jersey Multipart / Missing Dependencies

From: Stefan Heinz <st.heinz_at_googlemail.com>
Date: Mon, 23 Aug 2010 17:33:02 +0200

Hello!
I'm using jersey-multipart to process form data.

@Path("/form")
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response postFileByForm(@FormDataParam("file") InputStream in,
      @Inject DataBaseService service,
      @FormDataParam("file") FormDataContentDisposition contentDisp) {
      ...

After having switched the multipart version in maven back from 1.4-xxx
to 1.3 this works fine in Tomcat. My unit tests use the
jersey-test-framwork with grizzly and there the same error occurs as
with 1.4-xxx before:
Having both @FormDataParams (i.e. InputStream AND
FormDataContentDisposition) results in

SCHWERWIEGEND: The following errors and warnings have been detected with
resource and/or provider classes:
      SEVERE: Missing dependency for method public
javax.ws.rs.core.Response
....postFileByForm(java.io.InputStream,....DataBaseService,com.sun.jersey.core.header.FormDataContentDisposition)
at parameter at index 0
      SEVERE: Missing dependency for method public
javax.ws.rs.core.Response
....postFileByForm(java.io.InputStream,....DataBaseService,com.sun.jersey.core.header.FormDataContentDisposition)
at parameter at index 2

The strange thing is I can keep ONE of the two FormDataParams and
everything works fine, but with both I get these errors.

Does anybody have any idea what goes wrong here?

Thanks in advanve,
     Stefan