JAX-RS File Upload Service

Hi,

I'm trying to create a JAX-RS service to hand file uploads. I'm using the code from http://puspendu.wordpress.com/2012/08/23/restful-webservice-file-upload-with-jersey/.

However, when I upload a file, I get the following error:

A message body reader for Java class com.sun.jersey.core.header.FormDataContentDisposition, and Java type class com.sun.jersey.core.header.FormDataContentDisposition, and MIME media type multipart/form-data; boundary=—-WebKitFormBoundary07ilrug6EWQ3NpB2 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.MimeMultipartProvider com.sun.jersey.core.impl.provider.entity.StringProvider ….

What can be the issue here? The JAR containing those classes are in the SDK.

Thanks

0 votes

1 answers

1339 views

ANSWER



I managed to fix this. It was because the jersey-multipart.jar wasn't the same version as the other jersey jars that are in the nxserver/lib folder.

0 votes