No such file or directory exception in FileCacheStore
dex80526 Apr 16, 2012 3:45 PMI ran into the following exceptions when I am testing the FileCacheStore in my code. It randomly happens.
Here is my environment:
ISPN 5.1.3 FINAL, CentOS 5.x, and Java 7
I configured the CacheStore as the following:
...
<namedCache name="ispn-test">
<clustering mode="replication">
<stateRetrieval
timeout="240000"
fetchInMemoryState="true"
alwaysProvideInMemoryState="false"
/>
<async useReplQueue="true" replQueueInterval="5000" replQueueMaxElements="500" asyncMarshalling="false" />
</clustering>
<loaders passivation="false" shared="false" preload="true">
<!-- We can have multiple cache loaders, which get chained -->
<loader class="org.infinispan.loaders.file.FileCacheStore"
fetchPersistentState="true"
purgerThreads="3"
purgeSynchronously="true"
ignoreModifications="false"
purgeOnStartup="false">
<!-- See the documentation for more configuration examples and flags. -->
<properties>
<property name="location" value="/tmp/test/cacheData/cipher"/>
</properties>
<async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>
</loader>
</loaders>
<transaction transactionMode="NON_TRANSACTIONAL"/>
<eviction
maxEntries="50"
strategy="LRU"
/>
<!-- time units below are millseconds -->
<expiration
wakeUpInterval="-1"
lifespan="-1"
maxIdle="-1"
/>
</namedCache>
...
I noticed that the cahce store dir is not created on the filesystem.
What cause the failures? Do I miss something in the config?
======
2012-04-16/13:08:41.661/MDT [CoalescedAsyncStore-5] ERROR org.infinispan.loaders.file.FileCacheStore[338] - ISPN000063: Exception while saving bucket Bucket{entries={TestAds_userSearch=ImmortalCacheEntry{key=TestAds_userSearch, value=ImmortalCacheValue {value=[B@6a5baf1c}}}, bucketId='-150279168'}
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:947)
at org.infinispan.loaders.file.FileCacheStore$BufferedFileSync.write(FileCacheStore.java:530)
at org.infinispan.loaders.file.FileCacheStore.updateBucket(FileCacheStore.java:336)
at org.infinispan.loaders.bucket.BucketBasedCacheStore.insertBucket(BucketBasedCacheStore.java:137)
at org.infinispan.loaders.bucket.BucketBasedCacheStore.storeLockSafe(BucketBasedCacheStore.java:94)
at org.infinispan.loaders.bucket.BucketBasedCacheStore.storeLockSafe(BucketBasedCacheStore.java:49)
at org.infinispan.loaders.LockSupportCacheStore.store(LockSupportCacheStore.java:207)
at org.infinispan.loaders.decorators.AbstractDelegatingStore.store(AbstractDelegatingStore.java:68)
at org.infinispan.loaders.decorators.AsyncStore.applyModificationsSync(AsyncStore.java:245)
at org.infinispan.loaders.decorators.AsyncStore$AsyncProcessor.put(AsyncStore.java:405)
at org.infinispan.loaders.decorators.AsyncStore$AsyncProcessor.innerRun(AsyncStore.java:389)
at org.infinispan.loaders.decorators.AsyncStore$AsyncProcessor.run(AsyncStore.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)