1

Hello this is the followup problem for the following question.

I'm creating a Grails Plugin as a wrapper for a complex product. This product has a lot of dependencies to other products like hibernate. The issue is, that grails has some same dependencies but with different Versions. E.g. Grails -> hibernate 3.6.7 other product -> hibernate 3.5.6

I have modified the BuildConfig.groovy as described in the solution:

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 has resoved all dependencies and downloaded all required jar to the local repository. STS can resolve all the classes from the dependencies. On run-app there is a problem with hibernate:

Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.util.SoftLimitMRUCache.<init>(I)V

I suppose that the error apears because of multiple hibernate jars in the classpath. How to resolved it?

Thanks in anvance!

Community
  • 1
  • 1
Waldemar
  • 700
  • 7
  • 19

1 Answers1

1

Have you checked the fine manual?

http://grails.org/doc/1.3.x/guide/3.%20Configuration.html#3.7.7%20Plugin%20JAR%20Dependencies

It seems that you need an older version of hibernate in you project. So I guess the solution could be to

  • create a plugin project
  • remove the hibernate plugin
  • drop your jar files into your project
  • configure the hibernate jars an export=false as described in the documentation (see link above)
rdmueller
  • 10,742
  • 10
  • 69
  • 126