Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(run-main-0) java.lang.NoSuchMethodError

Tags:

I got a problem when I used sbt to run a spark job, I have finish compile, but when I run the command run, I got the problem below

 [error] (run-main-0) java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$.empty()Lscala/collection/immutable/HashSet; java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$.empty()Lscala/collection/immutable/HashSet;     at akka.actor.ActorCell$.<init>(ActorCell.scala:305)     at akka.actor.ActorCell$.<clinit>(ActorCell.scala)     at akka.actor.RootActorPath.$div(ActorPath.scala:152)     at akka.actor.LocalActorRefProvider.<init>(ActorRefProvider.scala:465)     at akka.remote.RemoteActorRefProvider.<init>(RemoteActorRefProvider.scala:124)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:422)     at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:78)     at scala.util.Try$.apply(Try.scala:191) 

Anyone knows what should I do?

like image 616
zhang Avatar asked Mar 30 '15 05:03

zhang


People also ask

What causes Java Lang NoSuchMethodError?

lang. NoSuchMethodError is a runtime error in Java which occurs when a method is called that exists at compile-time, but does not exist at runtime. The Java Garbage Collector (GC) cannot free up the space required for a new object, which causes a java. lang.

What is Exception in thread main Java Lang NoSuchMethodError?

NoSuchMethodError: main Exception in thread "main" can come due to various reasons like: 1) The class which you are trying to run doesn't have the main method. 2) The signature of the main method is not correct.


1 Answers

I met with the same error when I used scala-library-2.11 jar But when I replaced it with scala-library-2.10 jar . It runs fine

like image 73
Reddevil Avatar answered Nov 02 '22 02:11

Reddevil