我有一个用于简单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$1.reload(DevServerStart.scala:186)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon$31.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$1.$anonfun$reload$3(DevServerStart.scala:172)
at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
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:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsyncUnordered$$anon$31.onPush(Ops.scala:1318)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
[error] application
谁能让我知道我在这里错过了什么?是需要添加的某种配置设置吗?
任何指针都将非常有帮助。提前致谢!!
我恢复了对build.sbt文件的依赖关系,它现在似乎可以工作了。
当前构建.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
)
我不知道它是如何再次开始工作的,但解决了我的问题。谢谢!!!