java.lang.NoClassDefFoundError: org/hibernate/cache/EntityRegion configuring EHCache

前端 未结 4 760
[愿得一人]
[愿得一人] 2020-12-16 11:21

I\'m trying to add ehcache (v2.6.0) to my Hibernate 4.1.5.SP1 project, but having some configuration issues. Specifically, I\'m getting a ja

4条回答
  •  感情败类
    2020-12-16 12:15

    I checked maven the dependencies. Maven always loads ehcache-code when the hibernate-ehcache package is loaded.

    Dependency tree:

    +--- org.hibernate:hibernate-ehcache:4.3.0.Final
    |    +--- org.jboss.logging:jboss-logging:3.1.3.GA
    |    +--- org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1
    |    +--- org.hibernate:hibernate-core:4.3.0.Final (*)
    |    \--- net.sf.ehcache:ehcache-core:2.4.3
    |         \--- org.slf4j:slf4j-api:1.6.1 -> 1.6.6
    

    Please check your persistence configuration. It should not include any classes where the package name starts with "net.sf"

    For example, you have to replace the following string in your code:

    .setProperty("hibernate.cache.region.factory_class", "net.sf.ehcache.hibernate.EhCacheRegionFactory")
    

    with the following string:

    .setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.EhCacheRegionFactory")
    

提交回复
热议问题