Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Clover with jersey REST API not working for multipart/form-data

bala.kshatriya January 9, 2020

We have some REST API for our OSGI framework based application and we are trying to get the code coverage using clover. However when we try to hit the REST API using postman getting below error - 

"MessageBodyReader not found for media type=multipart/form-data;boundary=----WebKitFormBoundaryYWJL9uLrv2ZrzalW, type=class org.glassfish.jersey.media.multipart.FormDataMultiPart, genericType=class org.glassfish.jersey.media.multipart.FormDataMultiPart."

The parameters for the REST API has input of type FormDataMultiPart.

This is happening only with the cloverized JAR, however it works with normal JAR.

 

The Jersey version we are using is 2.22.2.

<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
<scope>${multipart.scope}</scope>
</dependency>


<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>

Can you please check for this issue.

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events