title: Why does starting StreamingContext fail with "IllegalArgumentException: requirement failed: No output operations registered, so nothing to execute"?
body: <p>I deployed master and workers on spark. When I try to strat some computations with SparkStreaming it fails. I created StreamingContext in sbt console.</p>
  
  <p>Please see below, the Error message, sample code, build.sbt and the command to run the program</p>
  
  <hr>
  
  <h2>ERROR message</h2>
  
  <pre><code>ERROR StreamingContext: Error starting the context, 
  marking it as stopped
  java.lang.IllegalArgumentException: requirement failed: No output operations 
  registered, so nothing to execute
  at scala.Predef$.require(Predef.scala:224)
  ...
  </code></pre>
  
  <hr>
  
  <h2>CODE</h2>
  
  <pre><code>/* StreamingEx.scala */
  import org.apache.spark._
  import org.apache.spark.streaming._
  import org.apache.spark.SparkConf
  import org.apache.spark.SparkContext
  import org.apache.spark.streaming.{ Seconds, StreamingContext }
  
  val conf = new SparkConf().setMaster("spark://169.254.112.244:7077").setAppName("TestingStreaming")
  val ssc = new StreamingContext(conf, Seconds(1))
  val lines = ssc.socketTextStream("localhost", 5577)
  val words = lines.flatMap(_.split(" "))
  val pairs = words.map(word =&gt; (word, 1))
  val wordCounts = pairs.reduceByKey(_ + _)
  ssc.start()
  ssc.awaitTermination()
  </code></pre>
  
  <hr>
  
  <h2>built.sbt</h2>
  
  <pre><code>name := "StreamingEx"
  
  version := "1.0"
  
  scalaVersion := "2.11.11"
  val sparkVersion = "2.1.1"
  
  libraryDependencies += "org.apache.spark" %% "spark-core" % sparkVersion
  libraryDependencies += "org.apache.spark" %% "spark-streaming" % sparkVersion % "provided"
  </code></pre>