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

Proxy-based Client use Multipart getting NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.4.9, 2.5.5, 2.6.2, 2.7
    • Component/s: JAX-RS
    • Labels:
      None
    • Environment:

      win32;x86_64;java 1.7.0_05-b05

    • Estimated Complexity:
      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

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              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