我在Play中使用activator run
運行應用程序,可能會有3次5次,它只會掛起,當我轉到http://localhost:9000/
時,它會一直坐在那裏旋轉。Play Framework在瀏覽器中點擊應用程序時掛起
我也看到很多promise timed out
錯誤。
我應該在哪裏尋找這個問題?
我開始用logLevel := Level.Debug
進行測井,但我沒有看到任何不妥之處。當應用程序在旋轉時,我根本看不到任何記錄。
如果我只是讓它坐和旋轉很長一段時間(約5分鐘),將最終給這個錯誤:
[info] play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[PrivilegedActionException: null]]
[info] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:265) ~[play_2.11-2.4.3.jar:2.4.3]
[info] at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:191) ~[play_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:50) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:59) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:57) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at scala.util.Either$RightProjection.flatMap(Either.scala:522) [scala-library.jar:na]
[info] at play.core.server.Server$class.getHandlerFor(Server.scala:57) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.NettyServer.getHandlerFor(NettyServer.scala:33) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$8.apply(PlayDefaultUpstreamHandler.scala:139) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$8.apply(PlayDefaultUpstreamHandler.scala:139) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] Caused by: java.security.PrivilegedActionException: null
[info] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_20]
[info] at play.runsupport.Reloader$.play$runsupport$Reloader$$withReloaderContextClassLoader(Reloader.scala:39) ~[na:na]
[info] at play.runsupport.Reloader.reload(Reloader.scala:321) ~[na:na]
[info] at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:113) ~[play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:111) ~[play-server_2.11-2.4.3.jar:2.4.3]
[info] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library.jar:na]
[info] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library.jar:na]
[info] at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423) ~[na:1.8.0_20]
[info] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[na:1.8.0_20]
[info] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:902) ~[na:1.8.0_20]
[info] Caused by: java.util.concurrent.TimeoutException: Futures timed out after [300000 milliseconds]
[info] at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219) ~[scala-library.jar:na]
[info] at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223) ~[scala-library.jar:na]
[info] at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:190) ~[scala-library.jar:na]
[info] at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53) ~[scala-library.jar:na]
[info] at scala.concurrent.Await$.result(package.scala:190) ~[scala-library.jar:na]
[info] at play.forkrun.ForkRun$$anonfun$askForReload$1.apply(ForkRun.scala:127) ~[na:na]
[info] at play.forkrun.ForkRun$$anonfun$askForReload$1.apply(ForkRun.scala:125) ~[na:na]
[info] at play.runsupport.Reloader$$anonfun$reload$1.apply(Reloader.scala:323) ~[na:na]
[info] at play.runsupport.Reloader$$anon$3.run(Reloader.scala:43) ~[na:na]
[info] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_20]
我應該指出,這是一個非常簡單的應用程序。到目前爲止,它只是渲染一些HTML。
它太糟糕了,因爲好像沒有在框架了很多很好的,但它僅僅是慢而且非常不可靠的。
請參閱http://stackoverflow.com/questions/16560348/how-to-change-future-timeout-with-play-framework-2-1-0或http://stackoverflow.com/questions/29747778/爲什麼-DO-I-GET-A-很長的超時功能於我-playframework-應用。看起來像一些Play配置的已知問題。 –
@Gaël - 給分支運行設置一個鏡頭 - 謝謝 – mtyson
@Gaël註釋掉這一行:'// fork in run:= true'做出了改變。日日夜夜。 – mtyson