I am going to work on allowing ehcache to use a Shared Cache manager. The separate cache instances should still remain, but we should not be forcing the creating of a new cache manager itself if possible.
https://issues.apache.org/jira/browse/CXF-5802 On Tue, May 27, 2014 at 7:49 AM, Jason Pell <[email protected]> wrote: > Sorry typo. I mean having a single global ehcache manager to manage all > cache instances. > On 27/05/2014 7:41 AM, "Jason Pell" <[email protected]> wrote: > >> I meant more sharing a single manager instance on a cache instance. But >> it's not too urgent for me now that I have cxf using my ehcache config >> file. >> On 27/05/2014 2:15 AM, "Colm O hEigeartaigh" <[email protected]> wrote: >> >>> I've merged a fix for the long filename issue: >>> >>> https://issues.apache.org/jira/browse/CXF-5766 >>> >>> With regards to sharing a single EhCache instance, the problem is that we >>> have different interfaces for token caching vs replay detection. For >>> token >>> caching, we don't persist tokens to disk, due to the fact that >>> SecurityTokens contain things that don't serialize (e.g. DOM Elements). >>> There is no reason why you couldn't use a single cache for UsernameToken >>> nonce + Signature/Timestamp caching though (ReplayCache) if you wanted. >>> >>> Colm. >>> >>> >>> On Mon, May 26, 2014 at 4:10 AM, Jason Pell <[email protected]> wrote: >>> >>> > I realised sharing is not going to work, unless the shutdown sequence >>> for a >>> > manager is also disabled where it's a single global instance. I >>> remember >>> > finding a problem with cxf and ehcache when it inadvertently used a >>> shared >>> > instance. It actually shut down the single global instance when a >>> service >>> > was shut down. >>> > >>> > Colm - any reason why we can't share a single ehcache instance across >>> the >>> > whole of cxf? I am willing to get into the code and have a go at >>> > refactoring to support a single instance, but its not much point if >>> there >>> > are reasons for creating separate instances I am not aware of. >>> > >>> > At the moment with the upgrade to 1.7.11 I am now getting: >>> > >>> > net.sf.ehcache.CacheException: java.io.FileNotFoundException: >>> > >>> > >>> ../tmp/cxf1876821037/ws-security%002enonce%002ecache%002einstance-{http%003a%002f%002fcom%002evedaadvantage%002fdp3%002f%0045nterprise%002f%0053ystem2%002f%0042usiness3%002f%0047raceful%0044eployment%0042usiness%0053ervice}%0047raceful%0044eployment%0042usiness%0053ervice.data >>> > (File name too long) >>> > at >>> > >>> > >>> net.sf.ehcache.store.disk.DiskStorageFactory.<init>(DiskStorageFactory.java:142) >>> > at >>> net.sf.ehcache.store.disk.DiskStore.create(DiskStore.java:155) >>> > at >>> > >>> net.sf.ehcache.store.disk.DiskStore.createCacheStore(DiskStore.java:183) >>> > at net.sf.ehcache.Cache.initialise(Cache.java:1154) >>> > at >>> > net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1336) >>> > at >>> > net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1396) >>> > at >>> > net.sf.ehcache.CacheManager.addCacheIfAbsent(CacheManager.java:1908) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.cache.EHCacheReplayCache.<init>(EHCacheReplayCache.java:59) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.cache.EHCacheReplayCacheFactory.newReplayCache(EHCacheReplayCacheFactory.java:34) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.WSS4JUtils.getReplayCache(WSS4JUtils.java:103) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.getReplayCache(WSS4JInInterceptor.java:822) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.configureReplayCaches(WSS4JInInterceptor.java:429) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:252) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JInInterceptor.handleMessage(PolicyBasedWSS4JInInterceptor.java:121) >>> > at >>> > >>> > >>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JInInterceptor.handleMessage(PolicyBasedWSS4JInInterceptor.java:106) >>> > >>> > >>> > >>> > >>> > On Mon, May 26, 2014 at 12:52 PM, Jason Pell <[email protected]> >>> wrote: >>> > >>> > > Hi, >>> > > >>> > > I already create a eh cache manager for caching spring security ldap >>> user >>> > > details. I would like to force CXF to use the very same eh cache >>> manager >>> > > rather than create a new one. >>> > > >>> > > I have the following spring bean: >>> > > >>> > > org.springframework.cache.ehcache.EhCacheManagerFactoryBean >>> > > >>> > > <bean id="ehCacheManager" >>> > > >>> > > class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> >>> > > <property name="configLocation" >>> > > value="file:${spring.config.dir}/ehcache.xml" /> >>> > > <property name="shared" value="true" /> >>> > > </bean> >>> > > >>> > > So I would like to put all of the configuration for ehcache into the >>> > > ehcache.xml I use for hibernate and spring security. >>> > > >>> > > Any suggestions as to how I might do this? >>> > > >>> > > >>> > > >>> > >>> >>> >>> >>> -- >>> Colm O hEigeartaigh >>> >>> Talend Community Coder >>> http://coders.talend.com >>> >>
