Play 2.3.5 and ReactiveMongo: MongoError ['No primary node available!']

I recently upgraded Play to version 2.3.5 and tried to use it with ReactiveMongo. However, every time I try to read data from mongoDB, an exception has occurred. This is my build.sbt:

name := """ReactiveMongoRestExample""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala) scalaVersion := "2.11.1" libraryDependencies ++= Seq( jdbc, anorm, cache, ws, "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23" ) 

This is stacktrace:

play.api.Application $$ anon $ 1: Running exception [[PrimaryUnavailableException $: MongoError ['No primary node is available! ']]] on play.api.Application $ class.handleError (Application.scala: 296) ~ [play_2.11-2.3.5.jar: 2.3.5] at play.api.DefaultApplication.handleError (Application.scala: 402) [play_2.11-2.3.5.jar: 2.3.5] at play.core.server.netty.PlayDefaultUpstreamHandler $$ anonfun $ 14 $$ anonfun $ apply $ 1.applyOrElse (PlayDefaultUpstreamHandler.scala: 205) [play_2.11 -2.3.5.jar: 2.3.5] at play.core.server.netty.PlayDefaultUpstreamHandler $$ anonfun $ 14 $$ anonfun $ apply $ 1.applyOrElse (PlayDefaultUpstreamHandler.scala: 202) [play_2.11-2.3.5.jar : 2.3.5] at scala.runtime.AbstractPartialFunction.apply (AbstractPartialFunction.scala: 36) [scala -library-2.11.2.jar: na] Called: reactivemongo.core.actors.Exceptions $ PrimaryUnavailableException $: MongoError ['No primary node is available! '] On reactivemongo.core.actors.Exceptions $ PrimaryUnavailableException $. (actors.scala) ~ [reactivemongo_2.11-0.10.5.0.akka23.jar: 0.10.5.0.akka23] at reactivemongo.core.actors.MongoDBSystem $$ anonfun $ pickChannel $ 4.Apply (actors.scala: 508) ~ [ reactivemongo_2.11-0.10.5.0.akka23.jar: 0.10.5.0.akka23] at reactivemongo.core.actors.MongoDBSystem $$ anonfun $ pickChannel $ 4.Apply (actors.scala: 508) ~ [reactivemongo_2.11-0.10.5.0 .akka23.jar: 0.10.5.0.akka23] at scala.Option.getOrElse (Option.scala: 120) ~ [scala -library-2.11.2.jar: na] at reactivemongo.core.actors.MongoDBSystem.pickChannel (actors .scala: 508) ~ [Reactivemongo_2.11-0.10.5.0.akka23.jar: 0.10.5.0.akka23]

MongoDB works great. I can get data using the command line tool and IntelliJ.

I clicked the code on github

Maybe someone knows the problem and can help me? That would be awesome.

+7
mongodb reactivemongo
source share
2 answers

It probably cannot start the Mongo server. Go to the / bin folder and run mongo.
Your temporary folder may have too little space. try running: mongo --smallfiles

0
source share

The same problem, although updated for Play 2.3.8 with the same rx mongo plugin. Mondomb maintained excellent work under the shell of the mango, as did the Mongo explorer in idea 14.

Using mongodb.uri in application.conf:

mongodb.uri = "mongodb: // pxxxxxxxx: pxxxxxxxx @berne: 27017 / playdb"

Digging deeper on the assumption that this is a configuration issue.

Henry

0
source share

All Articles