对类文件'JSONGenericHandlers.class'中遇到的reactivemongo.api.collections.GenericHandlers的错误符号引用

时间:2014-10-16 09:06:28

标签: mongodb scala playframework-2.3 reactivemongo

我在使用反应性mongo玩我的api 2.3。最近,我试图清理项目,在此过程中,一些事情得到了更新。后来,当我试图运行或编译时,我得到了这些错误。除了干净,我没有做任何事情。请帮助我。

[info] Compiling 48 Scala sources and 1 Java source to /home/Ruthvick/zcapi/zceapi    /target  /scala-2.11/classes...
[error] bad symbolic reference to reactivemongo.api.collections.GenericHandlers encountered in class file 'JSONGenericHandlers.class'.
 [error] Cannot access type GenericHandlers in package reactivemongo.api.collections. The current classpath may be
[error] missing a definition for reactivemongo.api.collections.GenericHandlers, or JSONGenericHandlers.class may have been compiled against a version that's
[error] incompatible with the one found on the current classpath.
[error] /home/Ruthvick/zcapi/zceapi/app/controllers/Application.scala:28: type arguments [play.modules.reactivemongo.json.collection.JSONCollection] do not conform to method collection's type parameter bounds [C <: reactivemongo.api.Collection]
[error]     def collection: JSONCollection = db.collection[JSONCollection]("shoppage")
[error]                                                   ^
[error] /home/Ruthvick/zcapi/zceapi/app/controllers/Application.scala:47: could not find implicit value for parameter writer: GenericCollection.this.pack.Writer[play.api.libs.json.JsObject]
[error]             collection.insert(result).map { lastError =>
[error]                              ^

[error] 60 errors found
[error] (compile:compile) Compilation failed
[error] application - 

谢谢,

1 个答案:

答案 0 :(得分:1)

您的Play版本与最新的Play Reactive Mongo快照不兼容。您可以使用版本0.10.5。

将此添加到您的图书馆依赖关系

"org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23"