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

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1059

  • via GitHub by wc394915432
    ,
  • Stack trace

    • 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)[ehcache-2.8.1.jar:2.8.1] at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:381)[ehcache-2.8.1.jar:2.8.1] at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:473)[ehcache-2.8.1.jar:2.8.1] at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1067)[ehcache-2.8.1.jar:2.8.1] at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1051)[ehcache-2.8.1.jar:2.8.1] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[na:1.7.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:166)[na:1.7.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[na:1.7.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[na:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[na:1.7.0_25] at java.lang.Thread.run(Thread.java:724)[na:1.7.0_25] Caused by: java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextEntry(HashMap.java:894)[na:1.7.0_25] at java.util.HashMap$EntryIterator.next(HashMap.java:934)[na:1.7.0_25] at java.util.HashMap$EntryIterator.next(HashMap.java:932)[na:1.7.0_25] at java.util.HashMap.writeObject(HashMap.java:1098)[na:1.7.0_25] at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_25] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)[na:1.7.0_25] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)[na:1.7.0_25] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)[na:1.7.0_25] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)[na:1.7.0_25] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)[na:1.7.0_25] at org.apache.shiro.session.mgt.SimpleSession.writeObject(SimpleSession.java:461)[shiro-core-1.2.3.jar:1.2.3] at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_25] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)[na:1.7.0_25] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)[na:1.7.0_25] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)[na:1.7.0_25] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)[na:1.7.0_25] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1541)[na:1.7.0_25] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:439)[na:1.7.0_25] at net.sf.ehcache.Element.writeObject(Element.java:867)[ehcache-2.8.1.jar:2.8.1] at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_25] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)[na:1.7.0_25] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)[na:1.7.0_25] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)[na:1.7.0_25] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)[na:1.7.0_25] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)[na:1.7.0_25] at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97)[ehcache-2.8.1.jar:2.8.1] at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:399)[ehcache-2.8.1.jar:2.8.1] ... 11 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    iridiciridic
    2 times, last one
    franky lifranky li
    Once,
    Unknown visitor
    Unknown visitorOnce,
    AkshayAkshay
    6 times, last one
    Unknown visitor
    Unknown visitorOnce,
    13 more bugmates