【问题标题】:Grails with MongoDB and Hibernate带有 MongoDB 和 Hibernate 的 Grails
【发布时间】: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


    【解决方案1】:

    在邮件列表中找到这个:

    http://grails.1312388.n4.nabble.com/Upgrade-from-MongoDB-plugin-1-3-0-to-1-3-1-compile-error-td4651482.html

    从 MongoDB 插件版本 1.3.1 降级到 1.3.0,现在一切正常。

    【讨论】:

    • 我也有类似的经历,发现升级到 MongoDB 插件 1.3.3 也解决了这个问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-06
    • 2015-06-29
    • 2017-11-09
    • 1970-01-01
    • 1970-01-01
    • 2014-07-14
    • 1970-01-01
    相关资源
    最近更新 更多