Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6194

[multipart] Server handle Collection argument as single element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.3
    • 3.0.4, 2.7.15, 3.1
    • JAX-RS
    • None
    • Unknown

    Description

      @POST
      @Path("/model")
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      void importModels(@Multipart(value = "workspace") String workspace,
      @Multipart(value = "content", type = MediaType.APPLICATION_JSON) Collection<Model> content)

      Server error [1].

      JacksonJsonProvider called with following isReadable args:
      1
      type=java.util.Collection
      genericType=java.util.Collection<Model>
      mediaType=multipart/form-data;boundary="uuid:af1d3363-4fc9-408b-b5d3-c352c7f33a49"
      2
      INFO: type=Model
      INFO: genericType=Model
      INFO: mediaType=application/json

      1.
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.talend.ipaas.web.common.bean.Flow out of START_ARRAY token
      at [Source: [

      {...}

      ]; line: 1, column: 1]
      at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
      at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:749)
      at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:745)
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1210)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:151)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:126)
      at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1232)
      at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:676)
      at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:800)
      at org.apache.cxf.jaxrs.provider.MultipartProvider.fromAttachment(MultipartProvider.java:238)
      at org.apache.cxf.jaxrs.provider.MultipartProvider.getAttachmentCollection(MultipartProvider.java:203)
      at org.apache.cxf.jaxrs.provider.MultipartProvider.readFrom(MultipartProvider.java:175)
      at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1325)
      at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1276)
      at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:812)
      at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:775)
      at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
      ... 32 more

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            amarkevich Alexey Markevich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: