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

Proxy-based Client use Multipart getting NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6
    • 2.4.9, 2.5.5, 2.6.2, 2.7
    • JAX-RS
    • None
    • win32;x86_64;java 1.7.0_05-b05

    • Moderate

    Description

      It's all about the client, when use Proxy-based client API

      Failed method signature of client restful interface as below:
      @POST
      @Path("/findEmployeePagingResults")
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      @Produces(MediaType.APPLICATION_JSON)
      List<Employee> findEmployeePagingResults(
      @Multipart(value="condition", type=MediaType.APPLICATION_JSON) EmployeeCondition condition,
      @Multipart(value="firstResult") int firstResult,
      @Multipart(value="maxResults") int maxResults);
      -------------------------------------------------------------------------
      After try...
      Success method signature is
      @POST
      @Path("/findEmployeePagingResults")
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      @Produces(MediaType.APPLICATION_JSON)
      List<Employee> findEmployeePagingResults(
      @Multipart(value="condition", type=MediaType.APPLICATION_JSON) EmployeeCondition condition,
      @Multipart(value="firstResult", type=MediaType.TEXT_PLAIN) int firstResult,
      @Multipart(value="maxResults", type=MediaType.TEXT_PLAIN) int maxResults);
      ---------------------------------------------------------------------------

      This problem occur cuz:
      MultipartProvider.java: line 369
      MessageBodyWriter<T> r = mc.getProviders().getMessageBodyWriter(cls, genericType, anns, mt);

      "mc.getProviders()" returns NULL when CXF try to get MessageBodyWriter for maxResults(that's the 3rd time this method called)

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            xcooper Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 8h
                8h
                Remaining:
                Remaining Estimate - 8h
                8h
                Logged:
                Time Spent - Not Specified
                Not Specified