使用reactivemongo 0.12.1与play 2.5.X

时间:2017-02-20 13:03:15

标签: mongodb scala playframework playframework-2.0 play-reactivemongo

我尝试使用play 2.5.12升级到reactive mongo 0.12.1,但是当我运行JVM退出时,我得到了以下堆栈跟踪:

来自线程[application-akka.actor.default-dispatcher-2]的未捕获错误关闭了JVM,因为' akka.jvm-exit-on-fatal-error'为ActorSystem [application] java.lang.NoClassDefFoundError启用:在java.lang.ClassLoader.defineClass(ClassLoader.java:763)的java.lang.ClassLoader.defineClass1(Native Method)中播放/ api / libs / concurrent / StateMachine在java.net上的java.net.URLClassLoader.access $ 100(URLClassLoader.java:73)java.net.URLClassLoader.defineClass(URLClassLoader.java:467)java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)。 URLClassLoader $ 1.run(URLClassLoader.java:368)java.net.URLClassLoader $ 1.run(URLClassLoader.java:362)java.security.AccessController.doPrivileged(Native Method)java.net.URLClassLoader.findClass(URLClassLoader。) java:361)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)at play.api.libs.streams.impl.EnumeratorSubscriptionFactory $ class.createSubscription (EnumeratorPublisher.scala:25)at play.api.libs.streams.impl.EnumeratorPublisher.createSubscription(EnumeratorP) ublisher.scala:33)在akka的play.api.libs.streams.impl.RelaxedPublisher.subscribe(RelaxedPublisher.scala:19)的play.api.libs.streams.impl.EnumeratorPublisher.createSubscription(EnumeratorPublisher.scala:33) .stream.impl.MaterializerSession.akka $ stream $ impl $ MaterializerSession $$ doSubscribe(StreamLayout.scala:1033)at akka.stream.impl.MaterializerSession.assignPort(StreamLayout.scala:1025)at akka.stream.impl.MaterializerSession $ $ anonfun $ exitScope $ 2.apply(StreamLayout.scala:907)at akka.stream.impl.MaterializerSession $$ anonfun $ exitScope $ 2.apply(StreamLayout.scala:906)at scala.collection.Iterator $ class.foreach(Iterator。 scala:893)在scala.collection.AbstractIterator.foreach(Iterator.scala:1336)at akka.stream.impl.MaterializerSession.exitScope(StreamLayout.scala:906)at akka.stream.impl.MaterializerSession $$ anonfun $ materializeModule $ 1 .apply(StreamLayout.scala:958)at akka.stream.impl.MaterializerSession $$ anonfun $ materializeModule $ 1.apply(StreamLayout.scala:950)at s cala.collection.immutable.Set $ Set3.foreach(Set.scala:163)at akka.stream.impl.MaterializerSession.materializeModule(StreamLayout.scala:950)at akka.stream.impl.MaterializerSession.materialize(StreamLayout.scala: 917)akka.stream.impl.ActorMaterializerImpl.materialize(ActorMaterializerImpl.scala:256)at akka.stream.impl.ActorMaterializerImpl.materialize(ActorMaterializerImpl.scala:146)at akka.stream.scaladsl.RunnableGraph.run(Flow.scala :350)at akka.stream.scaladsl.Source.runWith(Source.scala:81)at play.core.server.netty.NettyModelConversion.play $ core $ server $ netty $ NettyModelConversion $$ createChunkedResponse(NettyModelConversion.scala:256) at play.core.server.netty.NettyModelConversion $$ anonfun $ convertResult $ 1.apply(NettyModelConversion.scala:189)at play.core.server.netty.NettyModelConversion $$ anonfun $ convertResult $ 1.apply(NettyModelConversion.scala:166) at play.core.server.common.ServerResultUtils $ .resultConversionWithErrorHandling(ServerResultUtils.scala:127) at play.core.server.netty.NettyModelConversion.convertResult(NettyModelConversion.scala:235)at play.core.server.netty.PlayRequestHandler $$ anonfun $ play $ core $ server $ netty $ PlayRequestHandler $$ handleAction $ 2 $$ anonfun $在play.core.server.netty.PlayRequestHandler上使用$ 3.apply(PlayRequestHandler.scala:273)$ anonfun $ play $ core $ server $ netty $ PlayRequestHandler $$ handleAction $ 2 $$ anonfun $ apply $ 3.apply(PlayRequestHandler.scala :267)scala.concurrent.Future $$ anonfun $ flatMap $ 1.apply(Future.scala:253)at scala.concurrent.Future $$ anonfun $ flatMap $ 1.apply(Future.scala:251)at scala.concurrent。 play.api.libs.iteratee.Execution $ trampoline $ .executeScheduled(Execution.scala:110)at play.api.libs.iteratee.Execution $ trampoline $ .execute(impl.CallbackRunnable.run(Promise.scala:32) Execution.scala:70)scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)at scala.concurrent.impl.Promise $ DefaultPromise.tryComplete(Promise.scala:248)at scala.concurrent.Prom ise $ class.complete(Promise.scala:55)at scala.concurrent.impl.Promise $ DefaultPromise.complete(Promise.scala:153)at scala.concurrent.Future $$ anonfun $ andThen $ 1.apply(Future.scala: 436)scala.concurrent.Future $$ anonfun $ andThen $ 1.apply(Future.scala:435)at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)at akka.dispatch.BatchingExecutor $ AbstractBatch.processBatch (BatchingExecutor.scala:55)at akka.dispatch.BatchingExecutor $ BlockableBatch $$ anonfun $ run $ 1.apply $ mcV $ sp(BatchingExecutor.scala:91)at akka.dispatch.BatchingExecutor $ BlockableBatch $$ anonfun $ run $ 1.apply (BatchingExecutor.scala:91)at akka.dispatch.BatchingExecutor $ BlockableBatch $$ anonfun $ run $ 1.apply(BatchingExecutor.scala:91)at scala.concurrent.BlockContext $ .withBlockContext(BlockContext.scala:72)at akka.dispatch .batchingExecutor $ BlockableBatch.run(BatchingExecutor.scala:90)at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)at akka.dispatch.ForkJoinExecutorConfigu rator $ AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)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)引起:java.lang.ClassNotFoundException:play.api.libs.concurrent.StateMachine

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:7)

在检查了依赖关系图(https://github.com/jrudolph/sbt-dependency-graph)之后,最终为我工作的是从ReactiveMongo中排除播放迭代。

在我的build.sbt中,将导入更改为:

"org.reactivemongo" %% "play2-reactivemongo" % reactiveMongoVersion excludeAll( ExclusionRule("com.typesafe.play", "play-iteratees_2.11")