eclipse-ee4j / eclipse-ee4j/jersey

jersey-spring doesn't register sub resources with the SpringComponentProvider

Open
#3,481 4 comments 0 reactions 0 assignees View on GitHub
Component: extensions Priority: Major spring Type: Bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.