【发布时间】:2013-11-15 23:54:55
【问题描述】:
我希望能够在同一个应用程序中使用 Hibernate 和 MongoDB,定义 2 个数据源。我在 BuildConfig 中添加了以下内容:
compile ":mongodb:1.3.1"
当我尝试编译 grails 时,我得到以下信息:
| Installing zip mongodb-1.3.1.zip...
| Installing zip mongodb-1.3.1.zip....
| Installing zip mongodb-1.3.1.zip.....
| Installed plugin mongodb-1.3.1
| Installed plugin mongodb-1.3.1.
| Installed plugin mongodb-1.3.1..
| Installed plugin mongodb-1.3.1...
| Installed plugin mongodb-1.3.1....
| Installed plugin mongodb-1.3.1.....
| Error Fatal error during compilation org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/Users/gdboling/.grails/ivy-cache/org.grails/grails-hibernate/jars/grails-hibernate-2.2.4.jar!/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.class]; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor (Use --stacktrace to see the full trace)
MongoDB 插件的文档说这是可能的,但我不确定为什么我只是在将 MongoDB 插件添加到 BuildConfig 之后就会收到此编译错误。
更新:
在进行了更多谷歌搜索后,它看起来可能与 mongodb 插件尝试使用的版本与我们的 Grails (2.2.4) 版本正在使用的版本冲突。不过不太清楚如何解决或追踪这个问题。
【问题讨论】:
标签: hibernate mongodb grails grails-orm