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
@Hk2Inject does not work on the constructors of Guice services #184
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented I could really use a second set of eyes. Can you verify that the problem is really on their end? |
@glassfishrobot Commented My assumption is that the class you are describing here (DepartmentsResource) is being created by Guice, but that UriInfo, since it comes from Jersey should be provided by HK2. |
@glassfishrobot Commented @javax.inject.Inject {...} @HK2Inject ? At least then we can see if you can get UriInfo injected into your Guice service. |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
The Guice bridge fails to inject the following code:
Guice understands @Inject, Injector but not UriInfo. The bridge never kicks in for UriInfo, so HK2 never gets asked to supply a value. Guice fails, saying that UriInfo is not bound to an implementation.
@HK2Inject is not applicable on class constructors so it can't be used. I'm not sure it would help even if we could annotate the constructor this way.
This is reproducible always.
Affected Versions
[2.2.0]
The text was updated successfully, but these errors were encountered: