我尝试将使用 Scaldi 注入的应用程序从 Play 2.6.12 升级到 Play 2.6.13。在所有应用程序上,我们都遇到了同样的问题。
确切地说,它尝试实例化类型为“$$anon$1”或“play.api.inject.BindingKey$$anon$1@5d807417”的对象。这种类型显然不存在,所以它确实会导致堆栈中的错误。
java.lang.ArrayIndexOutOfBoundsException: 1
at java.lang.reflect.Executable.getAllGenericParameterTypes(Executable.java:318)
at java.lang.reflect.Parameter.getParameterizedType(Parameter.java:201)
at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$jparamsAsScala$1(JavaMirrors.scala:1209)
at scala.reflect.runtime.JavaMirrors$JavaMirror.jparamsAsScala(JavaMirrors.scala:1203)
at scala.reflect.runtime.JavaMirrors$JavaMirror.jconstrAsScala1(JavaMirrors.scala:1190)
at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$jconstrAsScala$1(JavaMirrors.scala:1182)
at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$toScala$1(JavaMirrors.scala:98)
at scala.reflect.runtime.TwoWayCaches$TwoWayCache.$anonfun$toScala$1(TwoWayCaches.scala:38)
at scala.reflect.runtime.TwoWayCaches$TwoWayCache.toScala(TwoWayCaches.scala:34)
at scala.reflect.runtime.JavaMirrors$JavaMirror.toScala(JavaMirrors.scala:96)
at scala.reflect.runtime.JavaMirrors$JavaMirror.scala$reflect$runtime$JavaMirrors$JavaMirror$$jconstrAsScala(JavaMirrors.scala:1182)
at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$7(JavaMirrors.scala:789)
at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$4(JavaMirrors.scala:789)
at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$1(JavaMirrors.scala:797)
at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.completeRest(JavaMirrors.scala:755)
at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter$LazyPolyType.complete(JavaMirrors.scala:804)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1535)
at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol$$anon$7.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$info(SynchronizedSymbols.scala:173)
at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.$anonfun$info$1(SynchronizedSymbols.scala:129)
at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.info(SynchronizedSymbols.scala:125)
at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.info$(SynchronizedSymbols.scala:129)
at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol$$anon$7.info(SynchronizedSymbols.scala:173)
at scala.reflect.internal.Types$TypeRef.baseClasses(Types.scala:2304)
at scaldi.jsr330.AnnotationBinding.<init>(AnnotationBinding.scala:47)
at scaldi.play.ScaldiBuilder$.$anonfun$toScaldiBindings$2(ScaldiBuilder.scala:210)
at scala.collection.immutable.List.map(List.scala:283)
at scaldi.play.ScaldiBuilder$.$anonfun$toScaldiBindings$1(ScaldiBuilder.scala:190)
at scaldi.SimpleContainerInjector.preparedBindings$lzycompute(Module.scala:376)
at scaldi.SimpleContainerInjector.preparedBindings(Module.scala:376)
at scaldi.SimpleContainerInjector.init(Module.scala:392)
at scaldi.Initializeable.partialInit(Injector.scala:299)
at scaldi.Initializeable.partialInit$(Injector.scala:297)
at scaldi.SimpleContainerInjector.partialInit(Module.scala:375)
at scaldi.MutableInjectorAggregation.$anonfun$init$1(Injector.scala:219)
at scala.collection.immutable.List.flatMap(List.scala:335)
at scaldi.MutableInjectorAggregation.init(Injector.scala:218)
at scaldi.Initializeable.partialInit(Injector.scala:299)
at scaldi.Initializeable.partialInit$(Injector.scala:297)
at scaldi.MutableInjectorAggregation.partialInit(Injector.scala:177)
at scaldi.Initializeable.initNonLazy(Injector.scala:284)
at scaldi.Initializeable.initNonLazy$(Injector.scala:284)
at scaldi.MutableInjectorAggregation.initNonLazy(Injector.scala:177)
at scaldi.play.ScaldiBuilder$.createScaldiInjector(ScaldiBuilder.scala:151)
at scaldi.play.ScaldiBuilder.createInjector(ScaldiBuilder.scala:96)
at scaldi.play.ScaldiApplicationBuilder.realInjector(ScaldiApplicationBuilder.scala:72)
at scaldi.play.ScaldiApplicationBuilder.build(ScaldiApplicationBuilder.scala:80)
at muneris.console.ui.ApplicationLoader.load(ApplicationLoader.scala:35)
at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:174)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:171)
这似乎在加载 Environment 类时发生。这里有人知道它可能是什么吗?