简体   繁体   English

Play Framework 2.3 MongoDB

[英]Play Framework 2.3 MongoDB

I'm trying to develop a little web app with the play framework 2.3 in scala. 我正在尝试使用scala中的play framework 2.3开发一个小型web应用程序。 For this application I need access to a MongoDB instance. 对于此应用程序,我需要访问MongoDB实例。 For now I could configure my build to download the dependencies for morphia. 现在我可以配置我的构建来下载morphia的依赖项。 This is the entry in dependencies for morphia: 这是morphia的依赖项:

libraryDependencies += "com.google.code.maven-play-plugin.org.playframework.modules.morphia" % "play-morphia" % "1.2.12"

During compilation the play compiler complains about a missing class play.db.Model . 在编译期间,播放编译器抱怨缺少类play.db.Model The exact error messages are these: 确切的错误消息是这些:

Error:Play 2 Compiler:  Class play.db.Model not found - continuing with a stub.
Error:Play 2 Compiler:                                              ^
Warning:Play 2 Compiler:  Class play.db.Model not found - continuing with a stub.
Warning:Play 2 Compiler:  Class play.data.binding.ParamNode not found - continuing with a stub.
Warning:Play 2 Compiler:  Class play.mvc.Scope not found - continuing with a stub.
Warning:Play 2 Compiler:  9 warnings found

Am I missing some dependency or configuration? 我错过了一些依赖或配置吗?

Thanks in advance! 提前致谢!

Try with this in build.sbt 在build.sbt中尝试使用它

"org.mongodb.morphia" % "morphia" % "0.109" “org.mongodb.morphia”%“morphia”%“0.109”

I think you are trying to use a library that was written for Play 1.x. 我想你正在尝试使用为Play 1.x编写的库。

There is, however, a new plugin for Play version 2 但是, Play版本2一个新的插件

Look at this link for more on how to use it. 请查看此链接以获取有关如何使用它的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM