[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Need help in using ehcache as cache provider for hibernate 4.3  XML
Forum Index -> Ehcache
Author Message
cmath

neo

Joined: 05/18/2014 07:59:32
Messages: 1
Offline

In ehcache documentation(version 2.8.2), I see that, for hibernate version 4 & above, we should use
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>

But, I don't see this class-org.hibernate.cache.ehcache.EhCacheRegionFactory- in hibernate 4.3(hibernate-core-4.3.0.Final.jar) jars. Please help me to use ehcache with hibernate 4.3

When I tried using, I got the following exception

Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.cache.ehcache.EhCacheRegionFactory] as strategy [org.hibernate.cache.spi.RegionFactory]

In the entity class I using the following annotations,
@Entity
@Cacheable
@Cache (usage=CacheConcurrencyStrategy.READ_WRITE)



following is the complete exception stack
Initial SessionFactory creation failed.org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.RegionFactory]
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.tutorial.util.HibernateSessionMgr.buildSessionFactory(HibernateSessionMgr.java:23)
at org.hibernate.tutorial.util.HibernateSessionMgr.<clinit>(HibernateSessionMgr.java:11)
at org.hibernate.tutorial.HibernateDemoV31.main(HibernateDemoV31.java:59)
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.RegionFactory]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:233)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:197)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:178)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:295)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2442)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2438)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1855)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
at org.hibernate.tutorial.util.HibernateSessionMgr.buildSessionFactory(HibernateSessionMgr.java:18)
... 2 more
Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.ehcache.EhCacheRegionFactory]
at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:101)
at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:46)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:83)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:223)
... 10 more
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.cache.ehcache.EhCacheRegionFactory] as strategy [org.hibernate.cache.spi.RegionFactory]
at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:128)
at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:87)
... 13 more
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team