スプレーのドキュメントで「最小限の例」を実行しようとしています: スプレー 1.2-RC2 > ルーティング
私はscala 2.10.3を使用しています。これはファイルDependencies.scalaに記述されている構成の一部です:
val sprayVersion = "1.2-RC2"
val sprayCan = "io.spray" % "spray-can" % sprayVersion
val sprayRouting = "io.spray" % "spray-routing" % sprayVersion
val sprayJson = "io.spray" %% "spray-json" % "1.2.5"
val akkaVersion = "2.2.3"
val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % akkaVersion
val akkaTestKit = "com.typesafe.akka" %% "akka-testkit" % akkaVersion
そして、これは例のような私の簡単なコードです:
import spray.routing.SimpleRoutingApp
object Main extends App with SimpleRoutingApp {
startServer(interface = "localhost", port = 8080) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
}
}
}
コンパイル時に次のエラーが発生します
bad symbolic reference. A signature in Http.class refers to term actor
in package akka which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling Http.class.
startServer(interface = "localhost", port = 8080) {
^
私は何が間違っているのか理解できません。
編集:エラーは、メソッドのリターン startServer で使用される Http.Bound が原因であると思います:
IO(Http).ask(Http.Bind(serviceActor, interface, port, backlog, options, settings)).mapTo[Http.Bound]
特に、akka.io.TcpをHttp.scalaにインポートすると問題が発生すると思います。Akkaのドキュメントで、より多くの IO については、akka 2.2.0 から「実験的」とマークされていることを読みました。
私はおかしくなりそうだ