我对reactivemongo和Play框架很新。当有时间添加MongoDB连接时,我正在使用Play应用程序。我决定使用reactiveMongo并根据教程制作所有内容: https://github.com/sgodbillon/reactivemongo-demo-app
我遇到的问题是,在添加插件并对其进行配置后,我开始从应用程序接收空响应(ERR_EMPTY_RESPONSE)。一旦我删除插件并进行初始化,我就会开始再次使用HTML文本接收正确的网络应用响应。
这是构建文件:
object ApplicationBuild extends Build {
val appName = "webapp"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm,
"org.reactivemongo" %% "play2-reactivemongo" % "0.10-SNAPSHOT"
)
val main = play.Project(appName, appVersion, appDependencies).settings(
resolvers += "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
)
}
插件配置文件很典型,只有一行:
400:play.modules.reactivemongo.ReactiveMongoPlugin
这是我在开始和打开页面时的控制台输出:
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[info] application - ReactiveMongoPlugin starting...
[info] application - ReactiveMongoPlugin successfully started with db 'users'! Servers:
[localhost:27017]
[info] play - Application started (Dev)
[WARN] [08/16/2013 23:12:28.922] [New I/O worker #1] [EventStream(akka://play)] [akka.event-handlers] config is deprecat
ed, use [akka.loggers]
这种行为可能是什么原因?
答案 0 :(得分:3)
经过一系列迭代后,我发现这是一个版本不匹配的问题,二进制无能。始终确保检查用于编译每个库的版本,因为有时它不会显示有关二进制不兼容的错误。