java – Initialization failure on JAXRS Jersey SpringBoot REST API

A simple image upload controller consuming multipart/form-data fails to initialize. The controller code @POST @Path(“/image”) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public Response uploadImage( @FormDataParam(“image”) InputStream fileInputStream ) throws Exception{ BufferedImage image = ImageIO.read(fileInputStream); System.out.println(“uploaded image”); return Response.ok(“done”).build(); } https://github.com/snambi/jersey-server/blob/master/src/main/java/org/github/api/test/jerseyserver/ImageController.java Error happens during the first request when Jersey is initializing the controller. org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model … Read more