eclipse-ee4j / eclipse-ee4j/jersey
jersey-spring doesn't register sub resources with the SpringComponentProvider
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
jersey-spring will only register spring bean resources with the SpringComponentProvider if they are registered at application initialization.
Since jersey only registers root resources and @Provider classes at application init, subResource spring beans are not registered with SpringComponentProvider and are managed by hk2 instead of spring.
When returning a sub resource, jersey should check if the subresource is a spring bean and return the spring managed bean, instead of the hk2 managed bean.
current workarounds:
1\. explicitly register each subresource with jersey upon startup (ex with ResourceConfig.register)
2\. or annotate the subresource with @Provider
#### Affected Versions
[2.24.1]
Contributor guide
Assessment
This issue has not been assessed yet.