我正在使用自定义应用加载器。
play.application.loader="AppLoader"
我的java.lang.ClassNotFoundException: AppLoader
应用程序出现play
错误。该应用程序之前工作正常。
堆栈跟踪
! @78am4d92i - Internal server error, for (GET) [/] ->
play.api.PlayException: Cannot load play.application.loader[play.application.loader [AppLoader] was not loaded.]
at play.utils.Reflect$.loadClass$1(Reflect.scala:111)
at play.utils.Reflect$.configuredClass(Reflect.scala:124)
at play.api.ApplicationLoader$.apply(ApplicationLoader.scala:73)
at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:173)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:171)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:189)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:106)
at akka.stream.impl.fusing.MapAsync$$anon$25.onPush(Ops.scala:1194)
Caused by: java.lang.ClassNotFoundException: AppLoader
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at play.utils.Reflect$.loadClass$1(Reflect.scala:105)
at play.utils.Reflect$.configuredClass(Reflect.scala:124)
at play.api.ApplicationLoader$.apply(ApplicationLoader.scala:73)
at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:173)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:171)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
[error] application -
答案 0 :(得分:0)
我的问题是我没有正确引用该类。我之前的代码将application.conf
中的类引用为play.application.loader="AppLoader"
。后来我将AppLoader
移到了app
包中,但是我忘记更改application.conf
中的条目。我不得不将其更改为play.application.loader="app.AppLoader"