eclipse-ee4j / eclipse-ee4j/jersey

NullPointerException throws in org.glassfish.jersey.model.internal.ComponentBag

Open
#5,064 3 comments 0 reactions 0 assignees View on GitHub
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

![image](https://user-images.githubusercontent.com/102425335/167250308-224e24a3-61ab-4a86-9a8c-4bc1589de43a.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.