title: Communication with JobManager failed error in wordcount example in flink
body: <p>I try to run the wordcount example: 
  <code>../bin/flink run WordCount.jar</code></p>
  
  <p>and gives me a "Communication with JobManager failed error" a few minutes after execution.</p>
  
  <p>source:
  <a href="https://github.com/apache/flink/blob/master/flink-examples/flink-scala-examples" rel="nofollow">https://github.com/apache/flink/blob/master/flink-examples/flink-scala-examples</a></p>
  
  <p>Exception as follows:</p>
  
  <pre><code>Executing WordCount example with built-in default data.
    Provide parameters to read input data from a file.
    Usage: WordCount &lt;text path&gt; &lt;result path&gt;
  org.apache.flink.client.program.ProgramInvocationException: The program execution failed: Communication with JobManager failed: Lost connection to the JobManager.
    at org.apache.flink.client.program.Client.runBlocking(Client.java:370)
    at org.apache.flink.client.program.Client.runBlocking(Client.java:348)
    at org.apache.flink.client.program.Client.runBlocking(Client.java:315)
    at org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:70)
    at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:804)
    at org.apache.flink.api.java.DataSet.collect(DataSet.java:410)
    at org.apache.flink.api.java.DataSet.print(DataSet.java:1495)
    at org.apache.flink.examples.java.wordcount.WordCount.main(WordCount.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:497)
    at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:395)
    at org.apache.flink.client.program.Client.runBlocking(Client.java:252)
    at org.apache.flink.client.CliFrontend.executeProgramBlocking(CliFrontend.java:675)
    at org.apache.flink.client.CliFrontend.run(CliFrontend.java:326)
    at org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:977)
    at org.apache.flink.client.CliFrontend.main(CliFrontend.java:1027)
  Caused by: org.apache.flink.runtime.client.JobExecutionException: Communication with JobManager failed: Lost connection to the JobManager.
    at org.apache.flink.runtime.client.JobClient.submitJobAndWait(JobClient.java:141)
    at org.apache.flink.client.program.Client.runBlocking(Client.java:368)
  ... 18 more
  Caused by: org.apache.flink.runtime.client.JobClientActorConnectionTimeoutException: Lost connection to the JobManager.
    at org.apache.flink.runtime.client.JobClientActor.handleMessage(JobClientActor.java:243)
    at org.apache.flink.runtime.akka.FlinkUntypedActor.handleLeaderSessionID(FlinkUntypedActor.java:88)
    at org.apache.flink.runtime.akka.FlinkUntypedActor.onReceive(FlinkUntypedActor.java:68)
    at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
    at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
    at akka.actor.ActorCell.invoke(ActorCell.scala:487)
  /src/main/scala/org/apache/flink/examples/scala/wordcount/WordCount.scala
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
    at akka.dispatch.Mailbox.run(Mailbox.scala:221)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:231)  
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)   
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
  </code></pre>
  
  <p>The exception above occurred while trying to run your command.</p>