gpt4 book ai didi

guice-3 - Guice 3.0-启动时出现ArrayIndexOutOfBoundsException吗?

转载 作者:行者123 更新时间:2023-12-04 17:45:24 31 4
gpt4 key购买 nike

为什么Guice 3.0针对错误的配置组件(例如,缺少@Inject)抛出此异常,而不是格式化消息?

Exception in thread "main" com.google.inject.internal.util.$ComputationException: java.lang.ArrayIndexOutOfBoundsException: 16640
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.util.$StackTraceElements.forMember(StackTraceElements.java:53)
at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:716)
at com.google.inject.internal.Errors.formatSource(Errors.java:678)
at com.google.inject.internal.Errors.format(Errors.java:555)
at com.google.inject.ConfigurationException.getMessage(ConfigurationException.java:70)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:391)
at java.lang.Throwable.toString(Throwable.java:480)
at java.lang.String.valueOf(String.java:2982)
at java.io.PrintStream.println(PrintStream.java:821)
at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:748)
at java.lang.Throwable.printStackTrace(Throwable.java:655)
at java.lang.Throwable.printStackTrace(Throwable.java:643)
at java.lang.Throwable.printStackTrace(Throwable.java:634)
at hu.daniel.hari.exercises.cleanarchitecture.payrollcasestudy.adapters.primary.ui.impl.swing._2.SwingUIMain2.<init>(SwingUIMain2.java:40)
at hu.daniel.hari.exercises.cleanarchitecture.payrollcasestudy.adapters.primary.ui.impl.swing._2.SwingUIMain2.main(SwingUIMain2.java:17)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 16640
at com.google.inject.internal.asm.$ClassReader.readClass(Unknown Source)
at com.google.inject.internal.asm.$ClassReader.accept(Unknown Source)
at com.google.inject.internal.asm.$ClassReader.accept(Unknown Source)
at com.google.inject.internal.util.$LineNumbers.<init>(LineNumbers.java:62)
at com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:36)
at com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:33)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549)
... 17 more

我的初始化代码是:
Injector injector = Guice.createInjector(new SwingUIModule(useCaseFactory));
injector.getInstance(MainFrameUI.class).show();

最佳答案

我认为问题在于Guice 3及以下版本如何处理lambda表达式。您可能必须升级到Guice 4才能解决此问题,如here所示。

关于guice-3 - Guice 3.0-启动时出现ArrayIndexOutOfBoundsException吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36376420/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com