Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why is play framework timing out?

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.

like image 642
mkrinblk Avatar asked Mar 24 '15 19:03

mkrinblk


People also ask

Is Play Framework popular?

In July 2015, Play was the 3rd most popular Scala library in GitHub, based on 64,562 Libraries. 21.3% of the top Scala projects used Play as their framework of choice. As of October 2013, the Play Framework is the most popular Scala project on GitHub.

Why play framework is used?

Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

What is activator in play framework?

The activator command can be used to create a new Play application. Activator allows you to select a template that your new application should be based off. For vanilla Play projects, the names of these templates are play-scala for Scala based Play applications, and play-java for Java based Play applications.

Is Play framework asynchronous?

Internally, Play Framework is asynchronous from the bottom up. Play handles every request in an asynchronous, non-blocking way. The default configuration is tuned for asynchronous controllers.


1 Answers

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 
like image 197
neurozen Avatar answered Oct 08 '22 02:10

neurozen