0

I am creating command line interface version for rest client api , created method works fine from normal test class/java program but same doesnot work when i built jar with maven-assembly-plugin. I am seeing below exception

ERROR:MessageBodyWriter not found for media type=application/json, type=class java.util.ArrayList, genericType=class java.util.ArrayList.

I tried adding below dependency as per recommendation in multiple posts but still didnot work ,and class com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider exists in assembly jar. still I see error MessageBodyWriter not found

<dependency>
    <groupId>com.fasterxml.jackson.jaxrs</groupId>
    <artifactId>jackson-jaxrs-json-provider</artifactId>
    <version>2.10.0</version>
</dependency> 

ERROR:MessageBodyWriter not found for media type=application/json, type=class java.util.ArrayList, genericType=class java.util.ArrayList

I am using jakarta libraries

santosh jk
  • 111
  • 1
  • 11
  • So Im assuming you are create an uber/fat jar? If you you need to configure it to concatenate the META-INF/services file. This is required for auto-discovery/registration of providers. Otherwise you need to manually register all thew providers – Paul Samsotha Aug 08 '23 at 19:53

0 Answers0