eclipse-ee4j / eclipse-ee4j/jersey
Client return wrong content, if content is EMPTY on 200 OK
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
We have a Webserivce:
```
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public String getSomeValue( .... ) {
}
```
Sometimes this Webservice returns an empty String. In this case, the Client side does strange things. The packet will be parsed two times (at least it will be printed 2 times by the LoggingFilter.
At first correctly:
```
Jul 27, 2016 12:02:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFORMATION: 8 * Client response received on thread main
8 < 200
8 < Cache-Control: private
8 < Content-Length: 0
8 < Content-Type: application/xml
8 < Date: Wed, 27 Jul 2016 10:02:39 GMT
8 < Expires: Thu, 01 Jan 1970 01:00:00 CET
8 < Server: Apache-Coyote/1.1
8 < Set-Cookie: JSESSIONID=A1DAA8CB4B949BC6219B58CDD19EB949; Path=/; HttpOnly
```
Second wrong:
```
Jul 27, 2016 12:02:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFORMATION: 7 * Client response received on thread main
7 < 200
7 < Cache-Control: private
7 < Content-Length: 0
7 < Content-Type: application/xml
7 < Date: Wed, 27 Jul 2016 10:02:39 GMT
7 < Expires: Thu, 01 Jan 1970 01:00:00 CET
7 < Server: Apache-Coyote/1.1
7 < Set-Cookie: JSESSIONID=A1DAA8CB4B949BC6219B58CDD19EB949; Path=/; HttpOnly
OpenPDM Server - Error report<!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-->
HTTP Status 401 -
type Status report
message
description This request requires HTTP authentication.
OpenPDM Server
```
The error seems to be either the first or last (cannot be verified) occured error for this client instance.
We use digest authentication, but this is not or at least should not be the root cause.
#### Environment
Jersey, Jackson
#### Affected Versions
[2.22, 2.23.1]
Contributor guide
Assessment
This issue has not been assessed yet.