eclipse-ee4j / eclipse-ee4j/jersey
NullPointerException throws in org.glassfish.jersey.model.internal.ComponentBag
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
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 BINDERS_ONLY = model -> model.getContracts().contains(Binder.class);
`
called by this:
```
public Set getInstances(final Predicate filter) {
return instancesView.stream()
.filter(input -> {
final ContractProvider model = getModel(input.getClass());
return filter.test(model);
})
.collect(Collectors.toCollection(LinkedHashSet::new));
}
```
Jersey 2.35
Java 11

Contributor guide
Research direction
Start with org.glassfish.jersey.model.internal.ComponentBag, especially getInstances and the BINDERS_ONLY predicate shown in the report. Reproduce the health-check path on Jersey 2.35 with Java 11 and trace why the contract model is null. Done means the reported path no longer throws NullPointerException and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100