-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Injection error when using a DynamicFeature
#5618
Comments
It looks like it used to be working fine on DropWizard 4.0.1 but it does not in 4.0.6. What Jersey versions are there? |
Hi @jansupol. Dropwizard 4.0.1 works fine because the aforementioned filter was firstly introduced in Dropwizard 4.0.3 (which uses Jersey 3.0.11). The current Dropwizard version 4.0.7 uses Jersey 3.0.12. |
@zUniQueX We will fix this. But beware of the InjectedFilterRegistrar being invoked for each endpoint method, including the synthetic ones (for HTTP OPTIONS for instance). |
Recently we have received an issue at dropwizard with a strange behavior regarding Jersey dependency injection. I've now reproduced this issue with Jersey-related classes only to exclude a dropwizard issue. The problem can be observed with the following
ContainerRequestFilter
:When registering this filter directly to the
ResourceConfig
as aClass
likeresourceConfig.register(InjectedFilter.class)
the filter works fine and theRef<HttpServletRequest>
holds the current request.However, when registering this filter through the
FeatureContext
of aDynamicFeature
, HK2 throws an exception:Here is a Jersey test case to reproduce the behavior:
The text was updated successfully, but these errors were encountered: