[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: rune66  XML
Profile for rune66 -> Messages posted by rune66 [5]
Author Message
Ok yes it's of course obvious but then I'm not sure wether Collections.synchronizedList-version is safe "enough" since it requires syncronized keyword to be used when iterating and I was wondering if that could be an issue in EHCache. On the other hand why should EHCache need to iterate over an object in the cache ...
Hi there

I'm using EHCache to store ArrayList's and from time to time the EHCache throws a ConcurrentModificationException:

0 [wppage.data] ERROR net.sf.ehcache.store.disk.DiskStorageFactory - Disk Write of S. Hansen failed:
net.sf.ehcache.CacheException: Failed to serialize element due to ConcurrentModificationException. This is frequently the result of inappropriately sharing thread unsafe object (eg. ArrayList, HashMap, etc) between threads
at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:401)
at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:381)
at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:473)
at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1067)
at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1051)

I'm modifying the ArrayList-objects outside the cache.

I was wondering if one shouldn't use the thread unsafe class to store in EHCache at all? Would it help to use the Collections.synchronizedList-version (even though this requires syncronized keyword to be used when iterating) or should I use a different list implementation like Vector?

With regards
\Rune
So I have to use the paid product to make this work?

This problem must be easy to fix?
Bumpin this.

I'm now trying the same with ehcache 2.8.1 and problem persists. Please anyone??
Hi there

I have setup the monitor kit 1.03 on a windows machine and have started the server (I had to remove the -j option to make the server run).

Now I run the EHCache client program which gives the following exception:

Code:
Exception in thread "CounterManagerImpl Timer" java.lang.NoSuchMethodError: net.sf.ehcache.Ehcache.getStatistics()Lnet/sf/ehcache/Statistics;
 	at org.terracotta.ehcachedx.monitor.probe.SampledCacheStatistics$4.call(SampledCacheStatistics.java:113)
 	at org.terracotta.ehcachedx.monitor.probe.SampledCacheStatistics$4.call(SampledCacheStatistics.java:111)
 	at org.terracotta.ehcachedx.monitor.probe.counter.sampled.PullSampledCounterImpl.recordSample(PullSampledCounterImpl.java:37)
 	at org.terracotta.ehcachedx.monitor.probe.counter.sampled.SampledCounterImpl$1.run(SampledCounterImpl.java:28)
 	at java.util.TimerThread.mainLoop(Unknown Source)
 	at java.util.TimerThread.run(Unknown Source)
 Exception in thread "main" net.sf.ehcache.CacheException: java.lang.IllegalStateException: Timer already cancelled.
 	at net.sf.ehcache.CacheManager.init(CacheManager.java:423)
 	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:290)
 	at textanalyzer.Main.main(Main.java:237)
 Caused by: java.lang.IllegalStateException: Timer already cancelled.
 	at java.util.Timer.sched(Unknown Source)
 	at java.util.Timer.schedule(Unknown Source)
 	at org.terracotta.ehcachedx.monitor.probe.counter.CounterManagerImpl.createCounter(CounterManagerImpl.java:36)
 	at org.terracotta.ehcachedx.monitor.probe.SampledCacheStatistics.<init>(SampledCacheStatistics.java:73)
 	at org.terracotta.ehcachedx.monitor.probe.CacheManagerService.registerCache(CacheManagerService.java:739)
 	at org.terracotta.ehcachedx.monitor.probe.ProbePeerListener.notifyCacheAdded(ProbePeerListener.java:108)
 	at net.sf.ehcache.event.CacheManagerEventListenerRegistry.notifyCacheAdded(CacheManagerEventListenerRegistry.java:159)
 	at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1423)
 	at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:813)
 	at net.sf.ehcache.CacheManager.doInit(CacheManager.java:498)
 	at net.sf.ehcache.CacheManager.init(CacheManager.java:392)
 	... 2 more

How to make this work?

With regards,
Rune
 
Profile for rune66 -> Messages posted by rune66 [5]
Go to:   
Powered by JForum 2.1.7 © JForum Team