How can I spray .io work with scala 2.11.1 akka 2.3.2

I want to use spray.io with scala 2.11.x akka 2.3.x, and I find the following on the spray.io project info page:

spray 1.3.1 is built against Scala 2.10.3 and Akka 2.3.0 as well as Scala 2.11.1 and Akka 2.3.2.

When I use the spray client, I run into some kind of problem, and then I find the following on the Documentation of spray.io page that the spray client depends on akka 2.10.x:

akka-actor 2.2.x (with ‘provided’ scope, i.e. you need to pull it in yourself)

What is meant by the provided area? How can I use it with another part of the program written in scala 2.11.x akka 2.3.x?

Edit

The following is the simplest use case shown on the page:

import akka.actor.ActorSystem
import scala.concurrent.Future
object main {
  def main(args: Array[String]) {
    import spray.http._
    import spray.client.pipelining._
    implicit val system = ActorSystem()
    import system.dispatcher // execution context for futures
    val pipeline: HttpRequest => Future[HttpResponse] = sendReceive
    val response: Future[HttpResponse] = pipeline(Get("http://spray.io/"))
  }
}

with build.sbt:

scalaVersion := "2.11.1"
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.2"
libraryDependencies += "io.spray" % "spray-client" % "1.3.1"

Although this compiles well, it encounters a runtime error like:

Uncaught error from thread [default-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[default]
java.lang.NoClassDefFoundError: scala/runtime/AbstractPartialFunction$mcVL$sp
  at ...
+4
source share
1

A , , , , . , akka-actor .

sbt, .

    "com.typesafe.akka"     %% "akka-actor"         % 2.3.2,
+5

All Articles