Я решил эту проблему !!!Попробуйте другой способ вызвать этот API:
CloseableHttpClient client = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("http://localhost:8080/kaaAdmin/rest/api/sendNotification");
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addBinaryBody("notification", new File("files/notification.json"),
ContentType.APPLICATION_JSON, "notification.json");
builder.addBinaryBody("file", new File("files/file.json"),
ContentType.APPLICATION_OCTET_STREAM, "file.json");
HttpEntity multipart = builder.build();
httpPost.addHeader("Authorization", "Basic AAAAAAAAAAA");
httpPost.setEntity(multipart);
CloseableHttpResponse response = client.execute(httpPost);
System.out.println(response.getStatusLine().getStatusCode());
client.close();
с двумя зависимостями
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.6</version>
</dependency>