Hi all,
We just migrated EhCache from version 1.6.1 to version 2.0.0. Now we have following problem:
When the application is terminated, the cachemanager is shut down. We do this by calling the shutdown() methon on our cache manager instance. It lools like during deregistration of the cachelisteners a java.lang.UnsupportedOperationException is thrown. This is happening because the remove() method of the COWIterator of the CopyOnWriteArrayList class is not supported!
Code:
java.lang.UnsupportedOperationException
at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1004)
at net.sf.ehcache.event.RegisteredEventListeners.unregisterListener(RegisteredEventListeners.java:247)
at ch.deltaenergy.collections.AbstractCollection$CacheExpiryListener.dispose(AbstractCollection.java:511)
at net.sf.ehcache.event.RegisteredEventListeners.dispose(RegisteredEventListeners.java:275)
at net.sf.ehcache.Cache.dispose(Cache.java:2085)
at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:1033)
Thanks for your help!
Cheers
Lorenzo