Chaitanya
Chaitanya

Reputation: 3638

Play application unexpected exception after running the server

I have a scala play application for simple CRUD operations. I was able to run this application and did fair amount of testing with it. However, now when I tried to run the application, the server started, but is unable to accept any http requests and fails abruptly.

I tried running following commands

clean
compile
update
reload

and all of them execute successfully. When I run the server using run command, I get an output on console as

[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...)

Now, as soon as I make any http request (which was working earlier) I get the following error.

[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 

Could anyone please let me know what I am missing here? Is it some kind of a configuration setting that needs to be added ?

Any pointers will be highly helpful. Thanks in advance !!!

Upvotes: 3

Views: 1228

Answers (1)

Chaitanya
Chaitanya

Reputation: 3638

I reverted my dependencies of build.sbt file and it seems to work now.

Current build.sbt (which is working)

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

Old build.sbt (which was giving me the error)

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
)

I do not know how it started working again, but solves my problem. Thanks !!!

Upvotes: 1

Related Questions