Hello Alex,

I used Multipart with Aries JAX-RS and I'm almost sure I didn't need to
mess with the configuration.
I annotated the class with @MultipartConfig and placed
a @Consumes(MediaType.MULIPART_FOR_DATA).

@Path("/firmware")
@Component(service = FirmwareService.class, //
immediate = true, //
scope = ServiceScope.SINGLETON, property = {
        JaxrsWhiteboardConstants.JAX_RS_RESOURCE + "=true",
        JaxrsWhiteboardConstants.JAX_RS_APPLICATION_SELECT + "=(" +
JaxrsWhiteboardConstants.JAX_RS_NAME + "=myApp)"
})
@MultipartConfig
public class FirmwareService {
....
    @POST
    @Path("/upload")
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    public Response uploadFirmware(@Context HttpServletRequest request) {
        try {
            doUploadFirmware(request);

Hope this helps

João Assunção

Email: [email protected]
Mobile: +351 916968984
Phone: +351 211933149
Web: www.exploitsys.com




On Thu, Nov 12, 2020 at 5:25 PM Alex Soto <[email protected]> wrote:

> With Karaf 4.3.0, using Aries JAX-RS 1.0.10,  how can I enable multi part
> support?
>
> I am  adding configuration file
> “org.apache.aries.jax.rs.whiteboard.default.cfg”  to the “etc” directory
>  with property:
>
> osgi.http.whiteboard.servlet.multipart.enabled=true
>
> But I am still getting error:
>
> java.lang.IllegalStateException: No multipart config for servlet
>
> When getting parts from  HttpServletRequest.
> Any help will be appreciated.
>
> Best regards,
> Alex soto
>
>
>
>
>

Reply via email to