2017-04-27 33 views
1

我正在使用我已使用的項目play sbt。我有我的應用程序,那是做工精細,但一段時間後它給我的錯誤,如 -

無法創建文件

/target/streams/compile/run/$global/streams/outjava.io.IOException: Too many open files 
    at sbt.ErrorHandling$.translate(ErrorHandling.scala:10) 
    at sbt.IO$.touch(IO.scala:143) 
    at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:129) 
    at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:113) 
    at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:124) 
    at sbt.std.TaskStreams$class.log(Streams.scala:56) 
    at sbt.std.Streams$$anon$3$$anon$2.log$lzycompute(Streams.scala:102) 
    at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:102) 
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.log$1(EvaluateTask.scala:269) 
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.apply(EvaluateTask.scala:273) 
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.apply(EvaluateTask.scala:268) 
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772) 
    at scala.collection.immutable.List.foreach(List.scala:318) 
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771) 
    at sbt.EvaluateTask$.logIncomplete(EvaluateTask.scala:268) 
    at sbt.EvaluateTask$.logIncResult(EvaluateTask.scala:261) 
    at sbt.EvaluateTask$.run$1(EvaluateTask.scala:348) 
    at sbt.EvaluateTask$.runTask(EvaluateTask.scala:361) 
    at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:64) 
    at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:62) 
    at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:293) 
    at sbt.Aggregation$.timedRun(Aggregation.scala:62) 
    at sbt.Aggregation$.runTasks(Aggregation.scala:71) 
    at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:112) 
    at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:110) 
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60) 
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60) 
    at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:244) 
    at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:241) 
    at sbt.Command$.process(Command.scala:92) 
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98) 
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98) 
    at sbt.State$$anon$1.process(State.scala:184) 
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98) 
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98) 
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) 
    at sbt.MainLoop$.next(MainLoop.scala:98) 
    at sbt.MainLoop$.run(MainLoop.scala:91) 
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70) 
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65) 
    at sbt.Using.apply(Using.scala:24) 
    at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65) 
    at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48) 
    at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32) 
    at sbt.MainLoop$.runLogged(MainLoop.scala:24) 
    at sbt.StandardMain$.runManaged(Main.scala:53) 
    at sbt.xMain.run(Main.scala:28) 
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109) 
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:128) 
    at xsbt.boot.Launch$.run(Launch.scala:109) 
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35) 
    at xsbt.boot.Launch$.launch(Launch.scala:117) 
    at xsbt.boot.Launch$.apply(Launch.scala:18) 
    at xsbt.boot.Boot$.runImpl(Boot.scala:41) 
    at xsbt.boot.Boot$.main(Boot.scala:17) 
    at xsbt.boot.Boot.main(Boot.scala) 

正因爲如此,每當我得到這個錯誤,在那之後我不能做任何操作在應用程序。我搜查了它,但我無法解決這個問題。我正在使用ubuntu 14.04Scala version is 2.11.8。謝謝你的時間。任何幫助都會很棒。

回答

0

基本上,你有兩個選擇:

  1. 只是增加打開的文件可能數量,就像描述。綜上所述,您應該添加行像這些提交/etc/security/limits.conf並重啓:

user soft nofile 9000

user hard nofile 65000

更換user與誰運行應用程序的用戶名。你也可以用實際的打開文件數量玩一下。這是一種簡單的方法,但它需要root權限,您以後可能再次遇到同樣的問題。這是一種解決方法。

  1. 發現,你爲什麼用here描述的方法有這個問題。這可能會更困難,但你可能會找到問題的根源,只是擺脫它。
+0

我已經使用這個,但沒有運氣與此。 – ganeshk