The persistent cache is cleared on redeployment of the war file.

69 views
Skip to first unread message

Shivaprasad Hegde

unread,
May 28, 2022, 10:35:05 AM5/28/22
to ehcache-users
Hi All,

Could you please suggest if you faced the below issue.

 I have configured the Ehcache XML file to persist 2 caches(users & cxf.oauth2.client.cache) but one cache is cleared (alias: cxf.oauth2.client.cache) when I redeploy the war file in Wildfly.  

I can see below Warning during redeployment
19:10:07,802 WARN  [org.ehcache.impl.internal.store.disk.OffHeapDiskStore] (ServerService Thread Pool -- 136) The index for data file ehcache-disk-store.data is out of date by 107886ms, probably due to an unclean shutdown. Creating a new empty store.

 There is no issue when I restart the server and the cache is preserved as expected.  

This is Apache CXF OAuth project where I am persisting the OAuth user and client details.

I have attached 3 files for your reference
1. Ehcache configuration file
2. Apache CXF beans config file
3.Apache CXF CacheDataProvider java file 
 
 I would appreciate it if you could help me resolve this issue. thanks.

Let me know in case you need additional information.  
beans.xml
cxf-oauth2-ehcache3.xml
JCacheOAuthDataProvider.java
Reply all
Reply to author
Forward
0 new messages