Reputation: 381
I have created a new play framework app in SCALA. If i run the application it runs as expected and i am able to open the URL localhost:9000, but after i created a lib folder and added some jars(spark jars) in that when i tries to run the application using the command play run, it shows the message
[error] p.nettyException - Exception caught in Netty
java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$.empty()Lscala/collection/immutable/HashSet;
at akka.actor.ActorCell$.<init>(ActorCell.scala:305) ~[akka-actor_2.10.jar:2.2.0]
at akka.actor.ActorCell$.<clinit>(ActorCell.scala) ~[akka-actor_2.10.jar:2.2.0]
at akka.actor.RootActorPath.$div(ActorPath.scala:152) ~[akka-actor_2.10.jar:2.2.0]
at akka.actor.LocalActorRefProvider.<init>(ActorRefProvider.scala:465) ~[akka-actor_2.10.jar:2.2.0]
at akka.actor.LocalActorRefProvider.<init>(ActorRefProvider.scala:453) ~[akka-actor_2.10.jar:2.2.0]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_91]
[error] p.nettyException - Exception caught in Netty
java.lang.NoClassDefFoundError: Could not initialize class play.api.libs.concurrent.Execution$
when i tries to open the URL localhost:9000 it shows "localhost page is not working".
Spark Version 2.0 Scala Version 2.10 and also i have tested with scala 2.11 and 2.12 same error reproducing.
Play framework version - 2.2.6
Upvotes: 0
Views: 474
Reputation: 838
First, if you created a new Play! project, why use version 2.2? The newest one is 2.5 and that may already fix your issue.
Second, to ensure you don't have any other version conflicts I suggest you use managed dependencies instead of putting them manually into the lib
folder.
For Apache Spark, you would add this line to your build.sbt
file:
libraryDependencies += "org.apache.spark" %% "spark-core" % "2.1.0"
as described in Spark's Quick Start Guide. You need to use Scala 2.10 or 2.11 (suggested) in your project.
If that doesn't resolve your issue, please post the contents of your build.sbt
and the controller code. Thanks.
Upvotes: 1