@Hk2Inject does not work on the constructors of Guice services #183
Comments
Reported by cowwoc |
Issue-Links: |
cowwoc said: |
cowwoc said: I could really use a second set of eyes. Can you verify that the problem is really on their end? |
@jwells131313 said: 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. |
@jwells131313 said: @javax.inject.Inject {...} @HK2Inject ? At least then we can see if you can get UriInfo injected into your Guice service. |
cowwoc said: |
@jwells131313 said: |
cowwoc said: |
@jwells131313 said: |
This issue was imported from java.net JIRA HK2-139 |
Closing this as this issue is migrated to eclipse-ee4j/glassfish-hk2#184 |
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: