Scala Spray没有类def def发现Spray Execution Directives

时间:2015-12-08 14:57:30

标签: scala spray

我正在推出一个喷雾http服务器。我发送到服务器的第一个请求已成功执行,但是不能处理后续请求并记录此堆栈跟踪:

Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig]
java.lang.NoClassDefFoundError: spray/routing/directives/ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1(ExecutionDirectives.scala:34)
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$apply$2.applyOrElse(ExecutionDirectives.scala:37)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext.failWith(RequestContext.scala:246)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
    at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.ClassNotFoundException: spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 32 more
Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig]
java.lang.NoClassDefFoundError: spray/routing/directives/ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1(ExecutionDirectives.scala:34)
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$apply$2.applyOrElse(ExecutionDirectives.scala:37)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext.failWith(RequestContext.scala:246)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
    at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-10] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig]
java.lang.NoClassDefFoundError: spray/routing/directives/ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1(ExecutionDirectives.scala:34)
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$apply$2.applyOrElse(ExecutionDirectives.scala:37)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext.failWith(RequestContext.scala:246)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
    at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
    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)
Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig]
java.lang.NoClassDefFoundError: spray/routing/directives/ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1(ExecutionDirectives.scala:34)
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$apply$2.applyOrElse(ExecutionDirectives.scala:37)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext.failWith(RequestContext.scala:246)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
    at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-11] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig]
java.lang.NoClassDefFoundError: spray/routing/directives/ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1$1
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.spray$routing$directives$ExecutionDirectives$class$$anonfun$$anonfun$$handleError$1(ExecutionDirectives.scala:34)
    at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4$$anonfun$apply$2.applyOrElse(ExecutionDirectives.scala:37)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext$$anon$3.handle(RequestContext.scala:102)
    at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
    at spray.routing.RequestContext.failWith(RequestContext.scala:246)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$3.applyOrElse(ExecutionDirectives.scala:89)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
    at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
    at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
    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)
Uncaught error from thread [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[NflDbApiActorSystemConfig

我不熟悉ExecutionDirectives错误或从哪里开始寻找我的问题。似乎我的代码没有找到某些类 - 但我不确定哪一个。

任何人都可以对此错误提供一些见解吗?

1 个答案:

答案 0 :(得分:0)

问题是我有两个独特的ActorSystems,我的服务器正在启动。