[
https://issues.apache.org/jira/browse/CXF-4409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sergey Beryozkin resolved CXF-4409.
-----------------------------------
Resolution: Fixed
Fix Version/s: 2.7.0
2.6.2
2.5.5
2.4.9
Assignee: Sergey Beryozkin
> 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
> Assignee: Sergey Beryozkin
> Priority: Minor
> Fix For: 2.4.9, 2.5.5, 2.6.2, 2.7.0
>
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> 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