You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2022/06/26 06:15:00 UTC

[jira] [Commented] (KARAF-7498) JAXRS Whiteboard with Java11 Does Not Work With multipart/form-data

    [ https://issues.apache.org/jira/browse/KARAF-7498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558846#comment-17558846 ] 

Jean-Baptiste Onofré commented on KARAF-7498:
---------------------------------------------

It looks like a Aries JAXRS issue (import) but let me double check.

> JAXRS Whiteboard with Java11 Does Not Work With multipart/form-data
> -------------------------------------------------------------------
>
>                 Key: KARAF-7498
>                 URL: https://issues.apache.org/jira/browse/KARAF-7498
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.3.7, 4.2.16
>         Environment: Karaf 4.2.16 and Karaf 4.3.7
> Java 11
> MacOS Monterey
>            Reporter: Thomas Dalton
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> Adding an endpoint to org.apache.karaf.examples.rest.whiteboard.BookingServiceRest with a form data field like:
> {quote}
> {{@POST}}
> {{@Path("/test")}}
> {{@Consumes(MediaType.MULTIPART_FORM_DATA)}}
> {{public Response formParam(@FormParam("data") String data) {}}
> {{    System.out.println("METHOD");}}
> {{    return Response.ok().build();}}
> {{}}}
> {quote}
> Results in an error when hit from Postman:
> {quote}Caused by: java.lang.NullPointerException: mimeType
> at java.awt.datatransfer.DataFlavor.<init>(DataFlavor.java:427) ~[?:?]
> at javax.activation.ActivationDataFlavor.<init>(ActivationDataFlavor.java:113) ~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
> at javax.activation.DataHandler.<init>(DataHandler.java:41) ~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
> at org.apache.cxf.attachment.AttachmentUtil.createAttachment(AttachmentUtil.java:420) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.ext.MessageContextImpl.createAttachments(MessageContextImpl.java:291) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.ext.MessageContextImpl.get(MessageContextImpl.java:79) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.utils.multipart.AttachmentUtils.getMultipartBody(AttachmentUtils.java:84) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.utils.JAXRSUtils.processFormParam(JAXRSUtils.java:1044) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.utils.JAXRSUtils.createHttpParameterValue(JAXRSUtils.java:967) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:927) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:842) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:215) ~[!/:3.4.3]
> at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:79) ~[!/:3.4.3]
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [!/:3.4.3]
> {quote}
> I thought it was originally the CXF version (3.2.5) that was used by Aries Whiteboard 1.0.6 so I installed Aries Whiteboard 2.0.1 that uses CXF 3.4.3 and still received the same error.
> I assume it is more related to the old spec version of the activation-api from servicemix specs.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)