I have gone through the hibernate 3 migration guide, and now I am a bit puzzled why setting the caching provider class does not work. I have added the following hibernate property:
<property name="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider</property>
and hibernate correctly states that the right cache provider is in use:
18:33:02,437 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCache
Provider
Still, when creating my session factory I get the exception below, which states that Hibernate attempts to load classes from the old net/sf/ehcache/ package.
Has anyone got a clue why Hibernate does this? Any hints would be highly appreciated.
Randahl
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory
.java:262)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
184)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1041)
at dk.rockit.puls.server.hibernate.SessionManager.initialize(SessionMana
ger.java:54)
|