users@jersey.java.net

[Jersey] Re: Uploading file to web-service: The resource configuration is not modifiable in this context

From: zmicerkashlach <dzmitry.kashlach_at_blazemeter.com>
Date: Wed, 9 Sep 2015 06:00:28 -0700 (MST)

Thanks for quick reply.
Sorry, I've forgotten one more dependency:

<dependency>
  <groupId>org.glassfish.jersey.bundles</groupId>
  <artifactId>jaxrs-ri</artifactId>
  <version>2.21</version>
</dependency>

> I would be very surprised if it is able to process any request.

My initial configuration worked for GET,DELETE and POST(w\o body)
requests. Only POST requests with multi-part body are failed.

After changing

*com.sun.jersey:jersey-server-1.9* to
*org.glassfish.jersey.core:jersey-server-2.21* I'm still getting "The
resource configuration is not modifiable in this context"

I'm dealing with jersey at first time, so, I guess, I've mismatched something.






On Wed, Sep 9, 2015 at 3:06 PM, Pavel Bucek-2 [via Jersey] <
ml-node+s576304n7583423h35_at_n2.nabble.com> wrote:

> Hi,
>
> please don't combine com.sun.jersey (1.x) and org glassfish.jersey (2.x)
> jars in single application. Your configuration does not make much sense
> and I would be very surprised if it is able to process any request.
>
> Plus - you should be using same version of all Jersey related
> dependencies.
>
> Regards,
> Pavel
>
> On 09/09/15 12:45, zmicerkashlach wrote:
>
> > Hi,
> >
> > I'm implementing REST web-service using jersey.
> >
> > *Dependencies:*
> > <dependency>
> > <groupId>com.sun.jersey</groupId>
> > <artifactId>jersey-server</artifactId>
> > <version>1.9</version>
> > </dependency>
> > <dependency>
> > <groupId>org.glassfish.jersey.media</groupId>
> > <artifactId>jersey-media-multipart</artifactId>
> > <version>2.21</version>
> > <exclusions>
> > <exclusion>
> > <groupId>org.glassfish.jersey.core</groupId>
> > <artifactId>jersey-common</artifactId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> >
> >
> > *Webservice:*
> >
> > @POST
> > @Path("/upload")
> > @Consumes(MediaType.MULTIPART_FORM_DATA)
> > @Produces(MediaType.APPLICATION_JSON)
> > public Object upload(@FormDataParam("file") InputStream
> > uploadedInputStream,
> > @FormDataParam("file") FormDataContentDisposition fileDetail
> > )
> >
> > *WebServiceConfig:*
> > @ApplicationPath("/")
> > public class ConWebServiceConfig extends Application {
> > @Override
> > public Set<Class&lt;?>> getClasses() {
> > Set<Class&lt;?>> s = new HashSet<Class&lt;?>>();
> > s.add(MultiPartFeature.class);
> > s.add(ConWebService.class);
> > return s;
> > }
> > }
> >
> > This gives me
> > java.lang.IllegalStateException: The resource configuration is not
> > modifiable in this context
> > in Tomcat.
> >
> > What should I check to resolve it? Thanks.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://jersey.576304.n2.nabble.com/Uploading-file-to-web-service-The-resource-configuration-is-not-modifiable-in-this-context-tp7583422.html
> > Sent from the Jersey mailing list archive at Nabble.com.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://jersey.576304.n2.nabble.com/Uploading-file-to-web-service-The-resource-configuration-is-not-modifiable-in-this-context-tp7583422p7583423.html
> To unsubscribe from Uploading file to web-service: The resource
> configuration is not modifiable in this context, click here
> <http://jersey.576304.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7583422&code=ZHptaXRyeS5rYXNobGFjaEBibGF6ZW1ldGVyLmNvbXw3NTgzNDIyfDcxMTQ1MjE0MA==>
> .
> NAML
> <http://jersey.576304.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Thanks,
   Dzmitry Kashlach
Blazemeter LTD <http://blazemeter.com/>: Load Testing Cloud | Software
Developer <http://lnkd.in/5W8s8k>
Tel. +375291142462
Skype: dmitry.kashlach
--
View this message in context: http://jersey.576304.n2.nabble.com/Uploading-file-to-web-service-The-resource-configuration-is-not-modifiable-in-this-context-tp7583422p7583424.html
Sent from the Jersey mailing list archive at Nabble.com.