Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError: org/hibernate/cache/access/AccessType #5

Open
rblazquez opened this issue Feb 18, 2015 · 1 comment
Open

NoClassDefFoundError: org/hibernate/cache/access/AccessType #5

rblazquez opened this issue Feb 18, 2015 · 1 comment

Comments

@rblazquez
Copy link

Trying to make it works following documentation i've found a problem:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cache/access/AccessType

This is hazelgrails 0.1 with hibernate4 ... are you aware about any problem with this configuration?

@robertoschwald
Copy link

robertoschwald commented Oct 21, 2016

Same problem with HazelGrails 1.0.2. Used dependency hazelcast-all is only for hibernate3.
To fix the problem, you must include hazelcast-hibernate4. As the plugin currently uses hibernate-all, you must exclude it, as it already contains com.hazelcast.hibernate.HazelcastCacheRegionFactory for Hibernate3, so unexpected results may occur based on the class loading order.
Therefore, add to your build.gradle:

  compile("org.grails.plugins:hazelgrails:1.0.2"){
    exclude(module:"hazelcast-all")
  }
  compile "com.hazelcast:hazelcast-hibernate4:3.6.2"

TODOS for the plugin:

  • replace hazelcast-all dependency with hazelcast depencency (base).
  • Improve the documentation to explain to add the needed hazelcast hibernate lib, based on the used Hibernate version (4 or 5). I think it's better than implementing some dynamic logic to choose the hibernate-hibernate version dependency automatically (since we have now Hibernate 4, and 5 for Grails 3.2.x).
  • Improve the example Grails3 project to use Hazelcast as 2nd level cache (currently it is used for Objects, only)
  • Implement integration test application within the plugin

Will provide a PR when I find time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants