jersey icon indicating copy to clipboard operation
jersey copied to clipboard

Guice Scope is LOCAL, preventing guice injection in Filter.

Open jerseyrobot opened this issue 8 years ago • 4 comments

GuiceScopeContext visibility was set to LOCAL instead of NORMAL.

https://github.com/hk2-project/hk2/commit/0ad31489bd8485ef152bf1e9f1a872f9d4383443

The affect of this is that i am now unable to obtain guice dependencies within ContainerRequestFilter.

Was there a reason that a NORMAL visibility caused memory leaks? Does the child service locator create a new Injector? I would imagine it was the application/module's fault if any memory leak was found.

jerseyrobot avatar May 10 '16 02:05 jerseyrobot

  • Issue Imported From: https://github.com/jersey/jersey/issues/3384
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @mpotociar

jerseyrobot avatar Apr 20 '18 08:04 jerseyrobot

@glassfishrobot Commented Reported by djairball

jerseyrobot avatar May 10 '16 02:05 jerseyrobot

@glassfishrobot Commented This issue was imported from java.net JIRA JERSEY-3112

jerseyrobot avatar Apr 25 '17 05:04 jerseyrobot

I believe I ran across this when trying to inject a Guice service using guice-bridge into a ContainerRequestFilter that is registered using a DynamicFeature.

It works just fine when using Feature... the service fails to be located only when using DynamicFeature.

I don't know enough about Jersey internals to know the difference between how service locators work between Feature and DynamicFeature.

I found this related hk2 GH ticket: https://github.com/eclipse-ee4j/glassfish-hk2/issues/31

sford avatar Apr 09 '24 02:04 sford