-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: userCache is not alive
PostPosted: Tue Jan 29, 2008 5:27 pm 
Newbie

Joined: Fri Jan 11, 2008 3:25 pm
Posts: 7
Hello,

Excuse me because my english is not good.

I have a application that it use Acegi and Hibernate, have two caches (a cache for hibernate and the userCache de Acegi). For configuracion them I use two files, a file for hibernate and other file for userCache but I get the next error:

Exception in thread "Thread-8" java.lang.IllegalStateException: The userCache Cache is not alive.
at net.sf.ehcache.Cache.checkStatus (Cache.java:1201)
at net.sf.ehcache.Cache.dispose(Cache.java:1081)
at net.sf.ehcache.CacheManager.shutdown(CacheManager. java:702)
at net.sf.ehcache.CacheManager$1.run(CacheManager.jav a:505)

I saw other post but I couldn´t solve the problem.

My application isn´t web application, it is a application with a method main.

My file for hibernate´s cache is:

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir"/>

<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120"
overflowToDisk="true" diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"/>
</ehcache>

My file for acegi´s cache is:

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir"/>
<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120"
timeToLiveSeconds="120" overflowToDisk="true" diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU"/>

<defaultCache name="userCache" maxElementsInMemory="10000" timeToIdleSeconds="120"
timeToLiveSeconds="120" overflowToDisk="true" diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="120"/>
</ehcache>

I indicate to Acegi what is the file for its configuracion in this way:

<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean"
p:shared="true">
<property name="configLocation">
<value>acegi-ehcache.xml</value>
</property>
</bean>

Somebody can help me?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 5:24 am 
Regular
Regular

Joined: Mon Aug 20, 2007 6:47 am
Posts: 74
Location: UK
I can't help with Acegi, but check that you have set the hibernate property:

Code:
hibernate.cache.provider_class=net.sf.ehcache.hibernate.EhCacheProvider


And ensure that ehcache.xml is in your classPath.

Also, I noticed your wrote the class "org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean". There's an unwanted space in there... presumably that's just a mistake when you copied and pasted into this forum?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 8:19 am 
Newbie

Joined: Fri Jan 11, 2008 3:25 pm
Posts: 7
My configuration the hibernate is:

hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
hibernate.cache.provider_configuration_file_resource_path=ehcache-hibernate.xml

I proved the cache provider class
hibernate.cache.provider_class=net.sf.ehcache.hibernate.EhCacheProvider
but the application didn´t compile, I got the next error:
java.lang.ClassNotFoundException: net.sf.ehcache.hibernate.EhCacheProvider

I have the jar ehcache1.2.4.jar, I think that it can be for Acegi.

Is correct my cache provider class?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.