运行spray-can

时间:2015-11-07 15:10:42

标签: scala akka spray spray-routing

我有一个多模块sbt项目,它使用spray-can作为其依赖项之一。这就是我在sbt中所拥有的:

"com.typesafe" % "config" % "1.2.0",
"io.spray" % "spray-routing" % 1.2.0,
"io.spray" % "spray-can" % 1.2.0,
"com.typesafe.akka" %% "akka-actor" % "2.3.11",

我使用scala版本2.11.6和Java 8.当我运行我的项目时,我收到以下错误:

Uncaught error from thread [my-actor-system-akka.actor.default-dispatcher-5] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[my-actor-system]
java.lang.NoClassDefFoundError: spray/can/HttpManager$$anonfun$receive$1
    at spray.can.HttpManager.receive(HttpManager.scala:42)
    at akka.actor.ActorCell.newActor(ActorCell.scala:558)
    at akka.actor.ActorCell.create(ActorCell.scala:578)
    at akka.actor.dungeon.FaultHandling$class.finishCreate(FaultHandling.scala:136)
    at akka.actor.dungeon.FaultHandling$class.faultCreate(FaultHandling.scala:130)
    at akka.actor.ActorCell.faultCreate(ActorCell.scala:369)
    at akka.actor.dungeon.FaultHandling$class.faultRecreate(FaultHandling.scala:59)
    at akka.actor.ActorCell.faultRecreate(ActorCell.scala:369)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:459)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
    at akka.dispatch.Mailbox.run(Mailbox.scala:219)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
16:04:22.382 [my-actor-system-akka.actor.default-dispatcher-3] ERROR akka.actor.ActorSystemImpl - Uncaught error from thread [my-actor-system-akka.actor.default-dispatcher-5] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.NoClassDefFoundError: spray/can/HttpManager$$anonfun$receive$1
    at spray.can.HttpManager.receive(HttpManager.scala:42) ~[spray-can-1.2.0.jar:na]
    at akka.actor.ActorCell.newActor(ActorCell.scala:558) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.ActorCell.create(ActorCell.scala:578) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.dungeon.FaultHandling$class.finishCreate(FaultHandling.scala:136) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.dungeon.FaultHandling$class.faultCreate(FaultHandling.scala:130) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.ActorCell.faultCreate(ActorCell.scala:369) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.dungeon.FaultHandling$class.faultRecreate(FaultHandling.scala:59) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.ActorCell.faultRecreate(ActorCell.scala:369) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:459) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.dispatch.Mailbox.run(Mailbox.scala:219) ~[akka-actor_2.11-2.3.11.jar:na]
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397) [akka-actor_2.11-2.3.11.jar:na]
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.11.6.jar:na]
Uncaught error from thread [inland24-actor-system-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for

1 个答案:

答案 0 :(得分:1)

这有助于解决我的问题:

{{1}}