0

I did some research on this and it seems it is due to some version mismatch. I am trying to resolve this from quite some time and not sure the fix. Any help is greatly appreciated.

This is my pom.xml

        <properties>
        <scala.version>1.6.2</scala.version>
      </properties>
        <dependencies>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-core_2.11</artifactId>
                <version>1.6.2</version>
            </dependency>

            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-sql_2.11</artifactId>
                <version>${scala.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-mllib_2.11</artifactId>
                <version>${scala.version}</version>
            </dependency>

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>2.11.8</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>

This is the maven scala plugin configuration which I am using:

   <plugin>
                        <groupId>org.scala-tools</groupId>
                        <artifactId>maven-scala-plugin</artifactId>
                        <version>2.11</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <scalaVersion>2.11.8</scalaVersion>
                        </configuration>
                    </plugin>

Exception Trace:

--- 2017-09-06 09:54:21,676 INFO SparkUI: Started SparkUI at http://10.222.159.160:4040 (org.apache.spark.ui.SparkUI)
    Exception in thread "main" java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;)Lscala/reflect/api/JavaUniverse$JavaMirror;
        at com.abc.ModelTrn$.prepare(ModelTrn.scala:64)
        at com.abc.ModelTrn$.main(ModelTrn.scala:20)
        at com.abc.ModelTrn.main(ModelTrn.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:498)

1 Answers1

1

Can't reproduce. I created Maven project with your pom.xml. Then I ran standard WordCount. It worked fine. Could you be more specific what you're doing?


By the way have you checked previous answers for this exception?

java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror

Getting exception : java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;) while using data frames

java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;) :Sparkcassandra connector

Dmytro Mitin
  • 48,194
  • 3
  • 28
  • 66