我正在尝试将一些 akka 演员配置为在 play2 应用程序的上下文中拥有一个持久邮箱。
在实例化时application.conf
正在读取配置。MongoBasedMailboxType
事件调度程序 { 邮箱类型 = akka.actor.mailbox.MongoBasedMailboxType }
但是我遇到了这个异常。
java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps;
at akka.util.Duration$.<init>(Duration.scala:76)
at akka.util.Duration$.<clinit>(Duration.scala)
at akka.actor.mailbox.MongoBasedMailboxSettings.<init>(MongoBasedMailboxSettings.scala:21)
at akka.actor.mailbox.MongoBasedMailboxType.<init>(MongoBasedMailbox.scala:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
我相信原因是下面的配置没有被识别。
akka {
actor {
mailbox {
mongodb {
uri = "mongodb://localhost/akka.mailbox"
timeout {
# time to wait for a read to succeed before timing out the future
read = 3000 ms
# time to wait for a write to succeed before timing out the future
write = 3000 ms
}
}
}
}
}
我也试过akka {... }
在play {}
没有运气的情况下把它包起来。
- scalaVersion := "2.10.1"
- “com.typesafe.akka”%“akka-mongo-mailbox”%“2.0.5”
- addSbtPlugin("play" % "sbt-plugin" % "2.1.5")