users@jersey.java.net

[Jersey] Problem with Jersey Multipart File Upload

From: hdev <sobisiak.h_at_shadowsrv.de>
Date: Fri, 25 Nov 2011 08:04:36 -0800 (PST)

Dear Forum,

Since some days I try to implement a file upload into my REST Webservice. I
have big problems to implement things like FormDataParam-Annotations or just
giving the Parameter with the Multipart-Data to the resource method.


I tried several constellations, like described in several examples - I'm
using Jersey 1.4, so first I was trying Jersey-multipart.jar at Version 1.4.

Actually my Resource looks like that:

@Path("myresource")
public Class MyResource {
...
...
...

        @POST
        @Path("berichtpicture")
        @Consumes(MediaType.MULTIPART_FORM_DATA)
        public void uploadFile(MultipartFormDataInput input) {
        ---
        }
}

Actually I included the RESTEasy Multipart libraries, but always if I use
this "construction", I get always more or less the same Exception:

Nov 25, 2011 5:01:28 PM com.sun.jersey.spi.container.ContainerRequest
getEntity
Schwerwiegend: A message body reader for Java class
org.jboss.resteasy.plugins.p
roviders.multipart.MultipartFormDataInput, and Java type interface
org.jboss.res
teasy.plugins.providers.multipart.MultipartFormDataInput, and MIME media
type mu
ltipart/form-data;boundary="qU2BsEwpKK1fg4iL9f6ZWBxW2OOfvdLyw" was not
found.
The registered message body readers compatible with the MIME media type are:
*/* ->
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
  com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
  com.sun.jersey.core.impl.provider.entity.EntityHolderReader

Maybe some more informations are necessary: I don't use maven, I downloaded
the jars and use my webservice with a Grizzly embedded Webserver.

Maybe someone can help me, where I can start to search my mistake? If you
need some more informations like Sourcecode or things like that, please tell
me.




--
View this message in context: http://jersey.576304.n2.nabble.com/Problem-with-Jersey-Multipart-File-Upload-tp7031662p7031662.html
Sent from the Jersey mailing list archive at Nabble.com.