« Return to Thread: Terracotta + Hibernate Second Level Caching Error:: java.lang.AbstractMethodError: net.sf.ehcache.Cache.setCacheLoader
java.lang.AbstractMethodError: net.sf.ehcache.Cache.setCacheLoader(Lnet/sf/ehcache/loader/CacheLoader;)V
at net.sf.ehcache.config.ConfigurationHelper.createCache(
ConfigurationHelper.java:422)at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(
ConfigurationHelper.java:334)at net.sf.ehcache.CacheManager.configure(
CacheManager.java:293)at net.sf.ehcache.CacheManager.__tc_wrapped_init(
CacheManager.java:225)at net.sf.ehcache.CacheManager.init(CacheManager.java)
at net.sf.ehcache.CacheManager.<init>(
CacheManager.java:186)at org.hibernate.cache.EhCacheProvider.start(
EhCacheProvider.java:127)at org.hibernate.impl.SessionFactoryImpl.<init>(
SessionFactoryImpl.java:183)at org.hibernate.cfg.Configuration.buildSessionFactory(
Configuration.java:1300)at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(
AnnotationConfiguration.java:915)at com.mystiqmobile.platform.db.hibernateobjects.HibernateUtil.initialize(
HibernateUtil.java:49)at com.mystiqmobile.platform.db.hibernateobjects.HibernateUtil.initialize(
HibernateUtil.java:33)at com.mystiqmobile.platform.db.hibernateobjects.test.TestDevice.main(
TestDevice.java:48)
tc-Config .XML
<?
xml version="1.0" encoding="UTF-8"?><
con:tc-config xmlns:con="http://www.terracotta.org/config"> <servers> <server host="%i" name="localhost"> <dso-port>9510</dso-port> <jmx-port>9520</jmx-port> <data>terracotta/server-data</data> <logs>terracotta/server-logs</logs> </server> <update-check> <enabled>true</enabled> </update-check> </servers> <clients> <logs>terracotta/client-logs</logs> <modules> <module name="tim-hibernate" version="1.1.2" group-id="org.terracotta.modules"/> <module group-id="org.terracotta.modules" name="tim-ehcache-1.3" version="1.1.2"/> </modules> </clients></
con:tc-config>
EHCache.XML
<?
xml version="1.0" encoding="UTF-8"?><
ehcache> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="50" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /> <cache name="TrialHibernateCache" maxElementsInMemory="50" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /> <cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="5" eternal="false" timeToLiveSeconds="120" overflowToDisk="true"/></
ehcache><?
xml version="1.0" encoding="utf-8"?><!
DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><
hibernate-configuration> <session-factory name="mydbSessionFactory"> <property name="connection.driver_class">org.gjt.mm.mysql.Driver</property> <property name="connection.password">root</property> <property name="connection.url">jdbc:mysql://localhost/trialDB</property> <property name="connection.username">root</property> <property name="default_schema">trialDB</property> <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property> <property name="current_session_context_class">thread</property> <property name="hbm2ddl.auto">update</property> <!-- C3P0 Stuff --> <property name="hibernate.c3p0.acquire_increment">3</property> <property name="hibernate.c3p0.idle_test_period">14400</property> <property name="hibernate.c3p0.timeout">25200</property> <property name="hibernate.c3p0.max_size">15</property> <property name="hibernate.c3p0.min_size">3</property> <property name="hibernate.c3p0.max_statements">0</property> <property name="hibernate.c3p0.preferredTestQuery">select 1;</property><property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property> <property name="hibernate.cache.use_second_level_cache">true</property> <property name="hibernate.cache.use_query_cache">true</property> <property name="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</property>
<!--- here list of mapping classes ---->
</session-factory> </session-factory></
hibernate-configuration>
I am annotating at Hibernate Objects(POJOS) for enabling Cache as shown below:
@Cache
(usage=CacheConcurrencyStrategy.READ_WRITE, region="TrialHibernateCache")
Any advice would be helpful.Thanking all in advance.
« Return to Thread: Terracotta + Hibernate Second Level Caching Error:: java.lang.AbstractMethodError: net.sf.ehcache.Cache.setCacheLoader
| Free Forum Powered by Nabble | Forum Help |