简体   繁体   中英

value resolveOne is not a member of akka.actor.ActorSelection

I get the above error message from here:

implicit val askTimeout = Timeout(60 seconds)
val workerFuture = workerContext actorSelection(payload.classname) resolveOne()
val worker = Await.result(workerFuture, 10 seconds)
worker ask Landau(List("1", "2", "3"))

specifically from the second line.. the import made is

import akka.actor._
import akka.util.Timeout
import akka.pattern.{ ask, pipe }
import scala.concurrent.duration._
import scala.concurrent.Await
import java.util.concurrent.TimeUnit

akka version is 2.2.1 and scala is 2.10.2, i'm using sbt 0.13 to build it all.. I cannot really understand what's wrong, since resolveOne is definetely coming from that package..

EDIT: I made a print of all the methods of the class with

ActorSelection.getClass.getMethods.map(_.getName).foreach { p => println(p)}

and this is the result:

apply
toScala
wait
wait
wait
equals
toString
hashCode
getClass
notify
notifyAll

I had the same problem and changed my Scala and Akka versions as described in the link below. I brought here part of my build.sbt for simplicity:

scalaVersion := "2.10.4"

resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"

libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT")

link: http://doc.akka.io/docs/akka/snapshot/intro/getting-started.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM