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?
>
>
>