spring jboss ehcache

Posted by boyd4715 on Stack Overflow See other posts from Stack Overflow or by boyd4715
Published on 2011-02-01T18:24:30Z Indexed on 2011/02/02 7:25 UTC
Read the original article Hit count: 581

Filed under:
|
|
|

I am trying to configure my application to make use of ehCache. I am using Spring 2.5.6, Jboss 5.1.0 GA and its embedded version of Hibernate along with ehCache-core V2.3.1.

I have done the following configuration:

<property name="hibernateProperties">
  <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    <prop key="hibernate.hbm2ddl.auto">update</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.jdbc.batch_size">20</prop>
    <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
    <prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop>
    <prop key="hibernate.cache.use_second_level_cache">true</prop>
    <prop key="hibernate.cache.use_structured_entries">true</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop>
    <prop key="hibernate.generate_statistics">true</prop>
    <!-- prop key="hibernate.cache.use_second_level_cache">true</prop>  
    <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
    <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
    <prop key="hibernate.cache.use_second_level_cache">true</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop-->
  </props>
</property>

This is my ehcache.xml

<defaultCache eternal="false" 
        overflowToDisk="false"
        maxElementsInMemory="50000" 
        timeToIdleSeconds="30" 
        timeToLiveSeconds="6000"
        memoryStoreEvictionPolicy="LRU"
/>
<cache name="com.model.SystemProperty"
        maxElementsInMemory="5000"
        eternal="true"
        overflowToDisk="false"
        memoryStoreEvictionPolicy="LFU" 
/>              

This file is located in my class path.

I have added the following to my domain object:

@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="vsg.ecotrak.admin.store.domain.Store", include="non-lazy")

When I start up the server, it gets stuck. Here is the output:

13:17:09,000 INFO  [SettingsFactory] Second-level cache: enabled
13:17:09,000 INFO  [SettingsFactory] Query cache: enabled
13:17:09,016 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
13:17:09,017 INFO  [RegionFactoryCacheProviderBridge] Cache provider: net.sf.ehcache.hibernate.SingletonEhCacheProvider

Any Ideal as to why this is happening?

I am running on a Windows 7 64 bit if that matters.


I downgraded the ehcache jar to V 1.2.3 and the server now starts.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about spring