scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

Singleton *Plugins* don't resolve dependencies recurrently

Open hinerm opened this issue 2 months ago • 7 comments

If you have a non-contextual object that you want to connect with other contextual objects, and thus try to Context.inject it, any @Parameters that are SingletonServices will NOT be created/injected. You will get a [ERROR] java.lang.IllegalArgumentException: Required service is missing.

If those singleton services are initialized beforehand, e.g. as an @Parameter or another contextual object that is used before injecting the non-contextual object, then the injection will proceed without errors.

hinerm avatar Nov 05 '25 05:11 hinerm