Cooper created CXF-4409: --------------------------- Summary: Proxy-based Client use Multipart getting NullPointerException Key: CXF-4409 URL: https://issues.apache.org/jira/browse/CXF-4409 Project: CXF Issue Type: Bug Components: JAX-RS Affects Versions: 2.6 Environment: win32;x86_64;java 1.7.0_05-b05 Reporter: Cooper Priority: Minor
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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira