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

api – PLEASE HELP: why do I get this error while using curl, jax-rs, java, and rest?

Below is my code, I am using curl command line tool, jax-rs, rest apis and java I get this error: “SEVERE: MessageBodyWriter not found for media type = text/plain, type=class java.util.ArrayList, genericType=class java.util.ArrayList”, when I go to localhost:8888/quotes after the command “mvn exec:java” What am I doing wrong? I have a main class, Quote class, … Read more