sbt run hangs on file change

1,758 views
Skip to first unread message

Ivan Poliakov

unread,
Mar 5, 2015, 7:28:22 AM3/5/15
to play-fr...@googlegroups.com
I am trying to build my first application with Play. I started out using Activator and that works fine, but when I try building and running the app directly from sbt, it runs fine for the first time, but whenever I change the code and it has to recompile it hangs.

The project is a very basic Play project generated with Activator.

[yyyy] $ run
[info] Updating {file:/home/xxxx/Projects/yyyy/}root...
[info] Resolving net.contentobjects.jnotify#jnotify;0.94 ...
[info] Done updating.
[info] Setting up Play fork run ... (use Ctrl+D to cancel)
[info] Updating {file:/home/xxxx/Projects/yyyy/}root...
[info] Resolving net.contentobjects.jnotify#jnotify;0.94 ...
[info] Done updating.
[info] 
[info] --- (Running the application, auto-reloading is enabled) ---
[info] 
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
[info] 
[info] (Server started, use Ctrl+D to stop and go back to the console...)
[info] 
[info] play - Application started (Dev)

At this point it works fine and handles the request, however if I change something in the code and save the file, it no longer handles the requests (the browser is stuck on "waiting for localhost...") and shows no apparent activity. It won't respond to ^D either, and when I try to stop it with ^C it goes as far as "terminating the forked Play process" and then hangs again until I kill the task. It behaves the same both on Windows and Linux. What am I doing wrong?

^C[info] JVM exiting, shutting down Play fork run ...
[info] Stopping Play fork run ...
[info] Play fork run already stopped ...
[info] Forked Play process did not exit on its own, terminating it
^C^C^C^C


Ivan Poliakov

unread,
Mar 5, 2015, 7:32:05 AM3/5/15
to play-fr...@googlegroups.com
So I left it like that for 5 minutes and it stopped with the following:

[error] application - 
[info] 
[info] ! Internal server error, for (GET) [/] ->
[info] 
[info] akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://play-fork-run/user/fork-run#1155191885]] after [300000 ms]
[info] at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:333) ~[akka-actor_2.11-2.3.4.jar:na]
[info] at akka.actor.Scheduler$$anon$7.run(Scheduler.scala:117) ~[akka-actor_2.11-2.3.4.jar:na]
[info] at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599) ~[scala-library-2.11.5.jar:na]
[info] at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109) ~[scala-library-2.11.5.jar:na]
[info] at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:597) ~[scala-library-2.11.5.jar:na]

Peter Vlugter

unread,
Mar 5, 2015, 4:12:28 PM3/5/15
to play-framework
Hi Ivan,

It looks like a problem with the new sbt server support in Activator.

Activator UI adds a `fork in run := true` to your build. To get the sbt command line working again, remove or comment out that line, or set it to false. Then it will use Play's normal development run again.

I couldn't reproduce this problem, so if you'd like to help, could you send me the .sbtserver directory in your project which has all the sbt server and connection log files? I'll follow up with the Activator team.

Thanks,
Peter
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

isai...@gmx.de

unread,
Mar 8, 2015, 7:51:06 PM3/8/15
to play-fr...@googlegroups.com
Hi Guys,
i am having the same sort of problem. Exactly 5 minutes after changing a source file and hitting F5 in the browser i am getting a time out as follows in the activator log printed on the stdout:
akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://play-fork-run/user/fork-run#-1890034726]] after [300000 ms]

> java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)

> scala -version
Scala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL

> activator --version
Das System kann den angegebenen Pfad nicht finden.
Die Datei "<anonymized>\.activator\1.3.2\activatorconfig.txt" kann nicht gefunden werden.
Das System kann den angegebenen Pfad nicht finden.
Die Datei "<anonymized>\.activator\activatorconfig.txt" kann nicht gefunden werden.sbt launcher version 0.13.8-M5
.sbtserver.zip

isai...@gmx.de

unread,
Mar 8, 2015, 7:56:53 PM3/8/15
to play-fr...@googlegroups.com
I wasn't finished with my post...
Anyway, here comes the missing information i wanted to add.

My system is running with windows 7 professional and i have attached my ".sbtserver" folder. Hope this helps.

Thanks in advance and best whishes from germany
Isaias

isai...@gmx.de

unread,
Mar 8, 2015, 8:02:32 PM3/8/15
to play-fr...@googlegroups.com
@Peter Your suggestion to remove the line from my build.sbt file restored the hit F5 compilation feature as i knew it from some previous version.

Thanks so far
Isaias

James S

unread,
Jun 28, 2015, 10:01:18 PM6/28/15
to play-fr...@googlegroups.com
Ok so It took me 4hs to figure this out (reading the solution here thanks a lot @Peter ). 

Plus sign for new users again Play Framework. 

Im a Spring-Boot user myself. Still trying to find out why people find play so cool.

Charles Crain

unread,
Oct 1, 2015, 4:46:20 PM10/1/15
to play-framework
I was having this same problem down to the same stack trace above.  Removing `fork in run := true` appears to have worked so far.  Thanks!!

-Charles
Reply all
Reply to author
Forward
0 new messages