title: spark 1.4.0 java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.elapsedMillis()J
body: <p>I'm using spark 1.4.0 / hadoop 2.6.0 (just for hdfs) and when running the Scala SparkPageRank example (<em>examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala</em>), I encounter the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.elapsedMillis()J
      at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:245)
      at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:313)
      at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:207)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
      at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:32)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
      at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:32)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
      at org.apache.spark.rdd.RDD$$anonfun$distinct$2.apply(RDD.scala:329)
      at org.apache.spark.rdd.RDD$$anonfun$distinct$2.apply(RDD.scala:329)
      at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147)
      at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:108)
      at org.apache.spark.rdd.RDD.withScope(RDD.scala:286)
      at org.apache.spark.rdd.RDD.distinct(RDD.scala:328)
      at org.apache.spark.examples.SparkPageRank$.main(SparkPageRank.scala:60)
      at org.apache.spark.examples.SparkPageRank.main(SparkPageRank.scala)
      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:497)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:621)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:170)
      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:193)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:112)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>
  
  <p>I'm not extremely familiar with java, but it seems that it's a <a href="https://github.com/google/guava" rel="noreferrer">guava</a> version issue</p>
  
  <p>The following information could be helpfup:</p>
  
  <pre><code>$ find ./spark -name *.jars | grep guava
  ./lib_managed/bundles/guava-16.0.1.jar
  ./lib_managed/bundles/guava-14.0.1.jar
  </code></pre>
  
  <p>part of the examples/pom.xml file: </p>
  
  <pre><code>...
   &lt;dependency&gt;
        &lt;groupId&gt;org.apache.cassandra&lt;/groupId&gt;
        &lt;artifactId&gt;cassandra-all&lt;/artifactId&gt;
        &lt;version&gt;1.2.6&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
            &lt;artifactId&gt;guava&lt;/artifactId&gt;
          &lt;/exclusion&gt;
  ...
  </code></pre>
  
  <p>And indeed it seems that the class does not contain the problematic method:</p>
  
  <pre><code>$ javap -p /mnt/spark/examples/target/streams/\$global/assemblyOption/\$global/streams/assembly/7850cb6d36b2a6589a4d27ce027a65a2da72c9df_5fa98cd1a63c99a44dd8d3b77e4762b066a5d0c5/com/google/common/base/Stopwatch.class
  
  Compiled from "Stopwatch.java"
  public final class com.google.common.base.Stopwatch {
    private final com.google.common.base.Ticker ticker;
    private boolean isRunning;
    private long elapsedNanos;
    private long startTick;
    public static com.google.common.base.Stopwatch createUnstarted();
    public static com.google.common.base.Stopwatch createUnstarted(com.google.common.base.Ticker);
    public static com.google.common.base.Stopwatch createStarted();
    public static com.google.common.base.Stopwatch createStarted(com.google.common.base.Ticker);
    public com.google.common.base.Stopwatch();
    public com.google.common.base.Stopwatch(com.google.common.base.Ticker);
    public boolean isRunning();
    public com.google.common.base.Stopwatch start();
    public com.google.common.base.Stopwatch stop();
    public com.google.common.base.Stopwatch reset();
    private long elapsedNanos();
    public long elapsed(java.util.concurrent.TimeUnit);
    public java.lang.String toString();
    private static java.util.concurrent.TimeUnit chooseUnit(long);
    private static java.lang.String abbreviate(java.util.concurrent.TimeUnit);
  }
  </code></pre>
  
  <p>I would like to understand better the issue, and if possible learn how to fix it :-)</p>