【发布时间】:2012-01-26 09:58:01
【问题描述】:
您好,这是following question 的后续问题。
我正在创建一个 Grails 插件作为复杂产品的包装器。该产品对 hibernate 等其他产品有很多依赖。问题是,grails 有一些相同的依赖项,但版本不同。例如。 Grails -> hibernate 3.6.7 其他产品 -> hibernate 3.5.6
我已按照解决方案中的描述修改了 BuildConfig.groovy:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
runtime ('org.ow2.bonita:bonita-server:5.6.1') {
excludes "slf4j-jdk14"
}
}
Grails 已解决所有依赖项并将所有需要的 jar 下载到本地存储库。 STS 可以从依赖项中解析所有类。在运行应用程序时,休眠存在问题:
Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.util.SoftLimitMRUCache.<init>(I)V
我认为错误是由于类路径中有多个休眠 jars 而出现的。如何解决?
提前感谢!
【问题讨论】: