eclipse-ee4j / eclipse-ee4j/jersey

DynamicFeature.configure(ResourceInfo, FeatureContext) doesn't give access to ServiceLocator

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

Description

`ServiceLocatorProvider.getServiceLocator(FeatureContext)` doesn't work inside `DynamicFeature` because of this [line](https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java#L243), which calls `.configure()` on a `ResourceMethodConfig` instance, not a wrapped `FeatureContextWrapper` instance.

Should instead pull the available `locator` in as well, to allow injection of services in the dynamically-created beans.

Contributor guide

Open the contributing guide

Research direction

Start at core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java around line 243 and trace how DynamicFeature.configure(ResourceInfo, FeatureContext) receives its context. Compare the ResourceMethodConfig call with the FeatureContextWrapper and the available ServiceLocator; done means ServiceLocatorProvider.getServiceLocator(FeatureContext) works for dynamically created beans.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.