users@jersey.java.net

Re: [Jersey] regarding Multipart missing dependencies and bug ID 575

From: Patrick Duin <patrick.duin_at_mpi.nl>
Date: Fri, 3 Sep 2010 08:36:52 +0200

Hi,

I did it the registration in the web.xml

     <servlet-name>JerseyServlet</servlet-name>
     <servlet-
class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-
class>
     <init-param>
     <param-name>com.sun.jersey.config.property.resourceConfigClass</
param-name>
     <param-value>com.sun.jersey.api.core.ClassNamesResourceConfig</
param-value>
     </init-param>
     <init-param>
     <param-name>com.sun.jersey.config.property.classnames</param-name>
     <param-
value
>
com
.sun
.jersey
.multipart
.impl.FormDataMultiPartDispatchProvider;my.own.RestServiceClass</param-
value>
     </init-param>


In java using a WebAppDescriptor (I use that for my junit testcases) I
do it like this:

WebAppDescriptor.Builder builder = new
WebAppDescriptor.Builder().initParam(WebComponent.RESOURCE_CONFIG_CLASS,
                  
ClassNamesResourceConfig
.class
.getName()).initParam(ClassNamesResourceConfig.PROPERTY_CLASSNAMES,
                 FormDataMultiPartDispatchProvider.class.getName() +
";" + RestServiceClass.class.getName())

I hope that helps.

Cheers,
  Patrick.


On Sep 2, 2010, at 11:36 PM, Mark Petrovic wrote:

> I'm having this same problem with Jersey 1.3 multipart form
> operations:
>
> http://jersey.576304.n2.nabble.com/Jersey-Multipart-Missing-Dependencies-td5453046.html
>
> Until Jersey 1.4 is released, this thread says there is a workaround
> "to explicitly register the class:
> com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider
> withthe resource config."
>
> Can someone please explain how to perform this registration?
>
> thx
>
>
>
>
> --
> Mark Petrovic
>
>