Details
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)