eclipse-ee4j / eclipse-ee4j/jersey

In multithreaded call to a REST endpoint, while sending response, the code hits HeaderValueException intermittently

Open
#4,585 0 comments 0 reactions 0 assignees View on GitHub
headers
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Issue 1:

While multiple calls are made simultaneously to an API, we hit this issue intermittently and seems to be a jersey issue.
Error message: Org.glassfish.jersey.message.internal.HeaderValueException: Too many "Content-Type" header values: "[application/json, application/json]"

This occurs at this line in code: Response.created(uriinfo.getAbsolutePathBuilder().scheme("https").path(newId.toString()).build()).build();

Issue 2:

While multiple calls are made simultaneously to the same API (let's say 30 calls are made to a REST endpoint) only 28/29 calls reach this API and it fails with NullPointerException. The code from our side seems fine.

Can not reproduce any of the 2 issues when a single call is made. Only reproduced over multiple threads are run together to make the calls simultaneously, that too intermittently.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.