【问题标题】:cannot compile spring-security-core because of ehcache由于 ehcache 无法编译 spring-security-core
【发布时间】:2014-07-01 00:28:40
【问题描述】:

我正在尝试将 spring-security 添加到我的 grail 项目中,但它在编译时失败。 这是我在 BuildConfig.groovy 中的插件: ` // 仅用于构建系统的插件 构建“:tomcat:7.0.54”

    // plugins for the compile step
    compile ":scaffolding:2.1.1"
    compile ':cache:1.1.6'
    compile ":asset-pipeline:1.8.11"
    compile ":mongodb:3.0.1"
    compile ":spring-security-core:2.0-RC3"


    // plugins needed at runtime but not for compilation
    //runtime ":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
    runtime ":jquery:1.11.1"`

编译失败,我收到了这个致命的错误信息:

编译时出现致命错误 java.lang.NoClassDefFoundError: net/sf/ehcache/config/CacheConfiguration

我按照here 的说明进行操作,但在“grails compile”步骤后卡住了。 我尝试在插件列表中添加 ehcache 依赖项,但它说它无法下载。我不知道该怎么办。该项目非常简单,我刚刚从我之前提供的链接开始教程。 我刚刚卸载了hibernate并安装了mongodb。

【问题讨论】:

  • 好的,卸载休眠并不是一个好主意,因为 spring-security-core 显然需要它。如果我想在整个 grail 项目中使用 mongo-db,我是否必须在我的所有域类中系统地添加 'static mapWith = 'mongo' 或者有没有办法为整个项目全局设置它?
  • 一个完整的例子在这里burtbeckwith.com/blog/?p=1992;如果您只使用 mongo(没有 hiberante),则不必编写 mapWith。而且您的问题似乎与 grails 2.4 有关,因为 Burts 代码适用于 2.3,但是一旦我更新它,我就会遇到与您相同的错误。
  • 您是否安装了除了描述中给出的任何其他插件,例如邮件插件?
  • @0alpha0 你的问题解决了吗?即使我很震惊,你能帮忙吗?
  • 我搬到了另一个项目。我现在不能告诉你。但是您尝试过 VeGo 答案吗?如果有效,请告诉我,我将验证他的答案。或者照 cfrick 说的做,降级到 2.3

标签: spring grails ehcache


【解决方案1】:

您应该将 ehcache 添加到依赖项而不是插件中。

dependencies {
    compile "net.sf.ehcache:ehcache-core:2.4.8"
}

我认为 spring-security-core 不需要休眠。

【讨论】:

    猜你喜欢
    • 2020-11-02
    • 2014-08-07
    • 2014-05-04
    • 1970-01-01
    • 2014-03-12
    • 2019-10-03
    • 2019-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多