hi Guys,
I am experimenting with the Hibernate Caching and trying to get ideas on cache management specially second level cache.
Here i am using "EhCache' for my small apps as it is the default for hibernate.
but i am getting exception :
Exception in
thread "main" java.lang.ExceptionInInitializerError
at org.muzza.java.test.HibernateTestClient.loadInTwoSessions(HibernateTestClient.java:122)
at org.muzza.java.test.HibernateTestClient.main(HibernateTestClient.java:25)
Caused by: net.sf.ehcache.CacheException: Error configuring from file:/D:/Workspace/Testworkspace/CoreJavaProject/config/ehcache.xml. Initial cause was Error configuring from input stream. Initial cause was null:11: Element <cache> does not allow attribute "name".
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:95)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:131)
at net.sf.ehcache.CacheManager.parseConfiguration(CacheManager.java:241)
at net.sf.ehcache.CacheManager.init(CacheManager.java:190)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:183)
at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
at org.muzza.java.util.HibernateUtil.<clinit>(HibernateUtil.java:18)
... 2 more
my ehcache.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<cache name="org.muzza.java.pojo.Employee"
maxElementsInMemory="300"
eternal="true"
overflowToDisk="false"
timeToIdleSeconds="12000"
timeToLiveSeconds="12000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
Please tell me the reason why this is saying this for the name attribute ??
Thanks