Open tracy0x01 opened 2 years ago
Interesting...
From model.getContracts()
either model.getContracts()
is null, which it cannot be, it must be Collections.emptyMap()
the worst. Or model
is null, which it cannot be, because instancesView
is built from the models...
can you substract a reproducer from your code?
That occasionally occurs in production environments. And I can't reproduce in my local env.
It's a simple use case, the code is like below, and the NullPointerException throws in request()
public boolean healthcheck() {
Response response = null;
try {
response =
client
.target(buildHealthCheckUri())
.request()
.property(ClientProperties.READ_TIMEOUT, 5000)
.get();
return response.getStatus() == 200;
} finally {
if (response != null) {
response.close();
}
}
return false;
}
hi @jansupol do we have any chance to reproduce and fix this? I still can't reproduce it. 😢
Hi, we have a healthcheck failed caused by this NullPointerException:
client .target(buildHealthCheckUri()) .request() ..
then NullPointerException throws in org.glassfish.jersey.model.internal.ComponentBag:
public static final Predicate<ContractProvider> BINDERS_ONLY = model -> model.getContracts().contains(Binder.class);
called by this:
Jersey 2.35 Java 11