服务器 运行 后播放应用程序意外异常
Play application unexpected exception after running the server
我有一个用于简单 CRUD 操作的 scala play 应用程序。我能够 运行 这个应用程序并用它做了相当多的测试。但是,现在当我尝试 运行 应用程序时,服务器已启动,但无法接受任何 http 请求并突然失败。
我尝试了运行遵循命令
clean
compile
update
reload
并且全部执行成功。当我 运行 服务器使用 run
命令时,我在控制台上得到一个输出
[IJ][user-service] $ run
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
现在,只要我发出任何 http 请求(之前可以正常工作),就会收到以下错误。
[error] application -
! @7bag02h83 - Internal server error, for (GET) [/service/api/setup] ->
play.api.UnexpectedException: Unexpected exception[IllegalArgumentException: requirement failed: sourceMapper parameter is no longer supported by createContext; use create method's devContext parameter instead]
at play.core.server.DevServerStart$$anon.reload(DevServerStart.scala:186)
at play.core.server.DevServerStart$$anon.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon.onPush(Ops.scala:1318)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:588)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:472)
Caused by: java.lang.IllegalArgumentException: requirement failed: sourceMapper parameter is no longer supported by createContext; use create method's devContext parameter instead
at scala.Predef$.require(Predef.scala:277)
at play.api.ApplicationLoader$.createContext(ApplicationLoader.scala:187)
at play.core.server.DevServerStart$$anon.$anonfun$reload(DevServerStart.scala:172)
at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
at play.core.server.DevServerStart$$anon.reload(DevServerStart.scala:171)
at play.core.server.DevServerStart$$anon.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon.onPush(Ops.scala:1318)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
[error] application
任何人都可以让我知道我在这里缺少什么吗?是否需要添加某种配置设置?
任何指示都会非常有帮助。提前致谢!!!
我恢复了 build.sbt 文件的依赖关系,它现在似乎可以工作了。
当前 build.sbt(正在工作)
libraryDependencies += guice
libraryDependencies += "com.typesafe.play" %% "play-slick" % "3.0.3"
libraryDependencies += "com.typesafe.play" %% "play-slick-evolutions" % "3.0.3"
libraryDependencies += "com.h2database" % "h2" % "1.4.196"
libraryDependencies += specs2 % Test
旧 build.sbt(给我错误)
libraryDependencies ++= Seq(
guice,
ws,
"com.typesafe.play" %% "play-slick" % "4.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "4.0.0",
"com.h2database" % "h2" % "1.4.197",
specs2 % Test
)
我不知道它是如何重新开始工作的,但解决了我的问题。谢谢!!!
我有一个用于简单 CRUD 操作的 scala play 应用程序。我能够 运行 这个应用程序并用它做了相当多的测试。但是,现在当我尝试 运行 应用程序时,服务器已启动,但无法接受任何 http 请求并突然失败。
我尝试了运行遵循命令
clean
compile
update
reload
并且全部执行成功。当我 运行 服务器使用 run
命令时,我在控制台上得到一个输出
[IJ][user-service] $ run
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
现在,只要我发出任何 http 请求(之前可以正常工作),就会收到以下错误。
[error] application -
! @7bag02h83 - Internal server error, for (GET) [/service/api/setup] ->
play.api.UnexpectedException: Unexpected exception[IllegalArgumentException: requirement failed: sourceMapper parameter is no longer supported by createContext; use create method's devContext parameter instead]
at play.core.server.DevServerStart$$anon.reload(DevServerStart.scala:186)
at play.core.server.DevServerStart$$anon.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon.onPush(Ops.scala:1318)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:588)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:472)
Caused by: java.lang.IllegalArgumentException: requirement failed: sourceMapper parameter is no longer supported by createContext; use create method's devContext parameter instead
at scala.Predef$.require(Predef.scala:277)
at play.api.ApplicationLoader$.createContext(ApplicationLoader.scala:187)
at play.core.server.DevServerStart$$anon.$anonfun$reload(DevServerStart.scala:172)
at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
at play.core.server.DevServerStart$$anon.reload(DevServerStart.scala:171)
at play.core.server.DevServerStart$$anon.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon.onPush(Ops.scala:1318)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
[error] application
任何人都可以让我知道我在这里缺少什么吗?是否需要添加某种配置设置?
任何指示都会非常有帮助。提前致谢!!!
我恢复了 build.sbt 文件的依赖关系,它现在似乎可以工作了。
当前 build.sbt(正在工作)
libraryDependencies += guice
libraryDependencies += "com.typesafe.play" %% "play-slick" % "3.0.3"
libraryDependencies += "com.typesafe.play" %% "play-slick-evolutions" % "3.0.3"
libraryDependencies += "com.h2database" % "h2" % "1.4.196"
libraryDependencies += specs2 % Test
旧 build.sbt(给我错误)
libraryDependencies ++= Seq(
guice,
ws,
"com.typesafe.play" %% "play-slick" % "4.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "4.0.0",
"com.h2database" % "h2" % "1.4.197",
specs2 % Test
)
我不知道它是如何重新开始工作的,但解决了我的问题。谢谢!!!