Воспроизведение приложения неожиданное исключение после запуска сервера - PullRequest
2 голосов
/ 24 марта 2019

У меня есть приложение Scala Play для простых операций CRUD. Я смог запустить это приложение и провел с ним немало испытаний. Однако теперь, когда я попытался запустить приложение, сервер запустился, но не смог принять никаких 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 

Может кто-нибудь, пожалуйста, дайте мне знать, что мне здесь не хватает? Это какой-то параметр конфигурации, который нужно добавить?

Любые указатели будут очень полезны. Заранее спасибо !!!

1 Ответ

1 голос
/ 24 марта 2019

Я восстановил зависимости файла 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
)

Я не знаю, как это снова заработало, но решает мою проблему. Спасибо !!!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...