why is play framework timing out?

半腔热情 提交于 2020-01-10 12:05:08

问题


I am starting the the application from the command line using either

    activator run 
    activator ~run

or after I start the activator console I use run or ~run.
everything seems to work and it gives the expected

 --- (Running the application, auto-reloading is enabled) ---

   play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

   (Server started, use Ctrl+D to stop and go back to the console...)

I can view the application in the browser and I can make changes in the code and they are reloaded just fine. the issue is that after only a couple minutes it seems like something "times-out" because if I try to reload after this the browser just sits there spinning. if i let it spin long enough I get.

[error] application - 
[info] 
[info] ! Internal server error, for (GET) [/] ->
[info] 
[info] java.util.concurrent.TimeoutException: Futures timed out after [300000 milliseconds]
[info]  at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219) ~[scala-library-2.11.1.jar:na]
[info]  at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223) ~[scala-library-2.11.1.jar:na]
[info]  at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:111) ~[scala-library-2.11.1.jar:na]
[info]  at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53) ~[scala-library-2.11.1.jar:na]
[info]  at scala.concurrent.Await$.result(package.scala:111) ~[scala-library-2.11.1.jar:na]

I would really appreciate any help. Since having to restart the app all over again each time I make a change really takes away the appeal of the framework.


回答1:


I upgraded to activator 1.3.2 with Play 2.3.9 and I also had the same issue. It drove me nuts. I found that the cause was the new set "fork in run" setting added in activator 1.3.2.

Open up build.sbt and you will find :

fork in run := true

Set this to false as follows :

fork in run := false



回答2:


Running activator start or better sbt start fixes the issue as well without having to remove the forking behavior.



来源:https://stackoverflow.com/questions/29241557/why-is-play-framework-timing-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!