您好,这是following question的后续问题。
我正在创建Grails插件作为复杂产品的包装。该产品与其他产品(例如休眠)有很多依赖性。问题是,grails具有某些相同的依赖关系,但具有不同的版本。例如。 Grails->休眠3.6.7其他产品->休眠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
我想由于类路径中有多个休眠jar而导致错误消失。怎么解决呢?
在此先感谢!
最佳答案
您检查了精美的手册吗?
http://grails.org/doc/1.3.x/guide/3.%20Configuration.html#3.7.7%20Plugin%20JAR%20Dependencies
看来您的项目中需要较旧的休眠模式。所以我想解决方案可能是
export=false
关于grails - 类路径中jar的不同版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9016377/