【发布时间】:2021-07-28 02:17:40
【问题描述】:
当我使用 Guice Injection 时,我经常犯一些错误。有时问题出在哪里很明显,但似乎 Guice 非常擅长吞下异常并给出相当神秘的错误消息。如:
Exception com.google.inject.CreationException: Unable to create injector, see the following errors:
1) [Guice/ErrorInjectingConstructor]: SomeTerminalException: Creation of SomeService client connection pool failed.
at SomeProvider.<init>(SomeOtherProvider.java:39)
while locating SomeProvider
at YourClientModule.configure(YourClientModule.java:10)
\_ installed by: SomeModule SomeProvider
我出于法律原因更改了类名,但意图是相同的。
调试这类问题的好方法是什么?
【问题讨论】:
标签: java dependency-injection guice