cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chester Kim (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6629) ConcurrentModificationException at AbstractResourceInfo.clearProxies()
Date Wed, 07 Oct 2015 18:52:26 GMT

     [ https://issues.apache.org/jira/browse/CXF-6629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Chester Kim updated CXF-6629:
-----------------------------
    Environment: 
Redhat Enterprise Linux 6, Java 8, Tomcat 8
cxf-rt-frontend-jaxrs 3.1.2

  was:Redhat Enterprise Linux 6, Java 8, Tomcat 8


> ConcurrentModificationException at AbstractResourceInfo.clearProxies()
> ----------------------------------------------------------------------
>
>                 Key: CXF-6629
>                 URL: https://issues.apache.org/jira/browse/CXF-6629
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.2
>         Environment: Redhat Enterprise Linux 6, Java 8, Tomcat 8
> cxf-rt-frontend-jaxrs 3.1.2
>            Reporter: Chester Kim
>              Labels: cxf-rt-frontend-jaxrs
>
> Occasionally, concurrentmodification exception happens in AbstractResourceInfo.  Following's
a peek of stack trace
> {code}
> java.util.ConcurrentModificationException at java.util.WeakHashMap$HashIterator.nextEntry(WeakHashMap.java:806)
at java.util.WeakHashMap$ValueIterator.next(WeakHashMap.java:833) at org.apache.cxf.jaxrs.model.AbstractResourceInfo.clearProxies(AbstractResourceInfo.java:355)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.clearThreadLocalProxies(AbstractResourceInfo.java:346)
at org.apache.cxf.jaxrs.provider.ProviderFactory.clearProxies(ProviderFactory.java:745) at
org.apache.cxf.jaxrs.provider.ProviderFactory.clearThreadLocalProxies(ProviderFactory.java:738)
at org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:1195) at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1156)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1092) at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865) at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:428)
at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.method(WebClient.java:1621) at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.method(WebClient.java:1616)
at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.get(WebClient.java:1536) at org.apache.cxf.jaxrs.client.spec.InvocationBuilderImpl.get(InvocationBuilderImpl.java:80)
at 
> ...
> {code}
> I noticed the codes around exception(AbstractResourceInfo:346) is as following (tlp.remove())
> {code}
>     private <T> void clearProxies(Map<Class<?>, Map<T, ThreadLocalProxy<?>>>
tlps) {
>         Map<T, ThreadLocalProxy<?>> proxies = tlps == null ? null : tlps.get(getServiceClass());
>         if (proxies == null) {
>             return;
>         }
>         for (ThreadLocalProxy<?> tlp : proxies.values()) {
>             if (tlp != null) {
>                 tlp.remove();
>             }
>         }
>     }
> {code}
> I don't think it's good idea to remove threadlocal value while iterating the list.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message