spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng Lian (JIRA)" <>
Subject [jira] [Created] (SPARK-3217) Shaded Guava jar doesn't play well with Maven build
Date Mon, 25 Aug 2014 23:12:58 GMT
Cheng Lian created SPARK-3217:

             Summary: Shaded Guava jar doesn't play well with Maven build
                 Key: SPARK-3217
             Project: Spark
          Issue Type: Bug
          Components: Build
    Affects Versions: 1.0.2
            Reporter: Cheng Lian
            Priority: Blocker

PR [#1813|] shaded Guava jar file and moved Guava
classes to package {{org.spark-project.guava}} when Spark is built by Maven. But code in {{org.apache.spark.util.Utils}}
still refers to classes (e.g. {{ThreadFactoryBuilder}}) in package {{}}.

The result is that, when Spark is built with Maven (or {{}}), commands
like {{bin/spark-shell}} throws {{ClassNotFoundException}}:
# Build Spark with Maven
$ mvn clean package -Phive,hadoop-2.3 -Dhadoop.version=2.3.0 -DskipTests

# Then spark-shell complains
$ ./bin/spark-shell
Spark assembly has been built with Hive, including Datanucleus jars on classpath
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/ThreadFactoryBuilder
        at org.apache.spark.util.Utils$.<init>(Utils.scala:636)
        at org.apache.spark.util.Utils$.<clinit>(Utils.scala)
        at org.apache.spark.repl.SparkILoop.<init>(SparkILoop.scala:134)
        at org.apache.spark.repl.SparkILoop.<init>(SparkILoop.scala:65)
        at org.apache.spark.repl.Main$.main(Main.scala:30)
        at org.apache.spark.repl.Main.main(Main.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:317)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:73)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException:
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 13 more

# Check the assembly jar file
$ jar tf assembly/target/scala-2.10/spark-assembly-1.1.0-SNAPSHOT-hadoop2.3.0.jar | grep -i
SBT build is fine since we don't shade Guava with SBT right now (and that's why Jenkins didn't
complain about this).

Possible solutions can be:
# revert PR #1813 for safe, or
# also shade Guava in SBT build and only use {{org.spark-project.guava}} in Spark

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message