PAR-278
[treasury-api-plugin] Fails to enable: concrete plugin not bound + HelpGenerator circular DI
TreasuryAPI failed to enable with two DI faults (surfaced once Business enabled and the cascade cleared):
-
Circular dependency.
TreasuryAPICommanddid@Inject HelpGenerator, andHelpGeneratortakes aCommandManager, which injects theSet<CommandHandler>(incl. this command) → GuiceCanNotProxyClasson the concreteCommandManager. Fix: injectProvider<CommandManager>and buildHelpGeneratoron demand (the Treasury/Business pattern). -
Concrete plugin not bound. Handlers inject the concrete
TreasuryAPItype, butTreasuryAPIModulenever bound it — it relied on an incorrect comment claiming HiberniaModule binds the concrete subtype (it only bindsJavaPlugin/Plugin). Guice JIT-constructed a secondTreasuryAPI→IllegalArgumentException: Plugin already initialized!. Fix:bind(TreasuryAPI.class).toInstance(plugin)in the module, mirroring Treasury'sTreasuryModule.
Verified: TreasuryAPI now enables.
Resources
- commitfeb4d48 Fix TreasuryAPI enable: bind concrete plugin + break HelpGenerator DI cycle (PAR-278)ParadauxIO/hibernia-economy
Comments
No comments yet.
Activity
- ParadauxIO linked a commit — Commit feb4d48 — Fix TreasuryAPI enable: bind concrete plugin + break HelpGenerator DI cycle (PAR-278)
- tesks created the issue