[ 
https://issues.apache.org/jira/browse/JCS-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18071697#comment-18071697
 ] 

Thomas Vandahl commented on JCS-246:
------------------------------------

Hi [~ionutv]

I see from the stack trace that you are trying to cache a HashMap. Is that 
correct? It looks like you are doing something with that map elsewhere while we 
are trying to calculate a hashCode for it. You need to handle the concurrent 
access in your code, for example by wrapping the HashMap into some control 
structure or using a ConcurrentHashMap.

> Thread 682(CacheEventQueue.QProcessor-UserThread-256) exited due to an 
> uncaught Exception: java.util.ConcurrentModificationException
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCS-246
>                 URL: https://issues.apache.org/jira/browse/JCS-246
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: TCP Lateral Cache
>    Affects Versions: jcs-3.2.1
>            Reporter: Ionut Vasilescu
>            Priority: Major
>
> Thread 682(CacheEventQueue.QProcessor-UserThread-256) exited due to an 
> uncaught Exception: java.util.ConcurrentModificationException.
> Stack Trace
> -----------
> java.util.ConcurrentModificationException
>        at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1605)
>        at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1638)
>        at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1636)
>        at java.base/java.util.AbstractMap.hashCode(AbstractMap.java:527)
>        at 
> org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPService.update(LateralTCPService.java:158)
>        at 
> org.apache.commons.jcs3.auxiliary.lateral.LateralCache.processUpdate(LateralCache.java:105)
>        at 
> org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging.updateWithEventLogging(AbstractAuxiliaryCacheEventLogging.java:65)
>        at 
> org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging.update(AbstractAuxiliaryCacheEventLogging.java:50)
>        at 
> org.apache.commons.jcs3.engine.CacheAdaptor.handlePut(CacheAdaptor.java:90)
>        at 
> org.apache.commons.jcs3.engine.AbstractCacheEventQueue$PutEvent.doRun(AbstractCacheEventQueue.java:277)
>        at 
> org.apache.commons.jcs3.engine.AbstractCacheEventQueue$AbstractCacheEvent.run(AbstractCacheEventQueue.java:216)
>        at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
>        at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
>        at java.base/java.lang.Thread.run(Thread.java:1583)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to