You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2019/08/02 18:04:00 UTC
[jira] [Commented] (CXF-8082) [Apache cxf 3.1.4]
ConcurrentModificationException
[ https://issues.apache.org/jira/browse/CXF-8082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16899094#comment-16899094 ]
Freeman Fang commented on CXF-8082:
-----------------------------------
Hi [~Samadou],
As I pointed the doc here
https://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe?
The cxf proxy isn't threadsafe for many cases, like
{code}
request context is PER INSTANCE. Thus, anything set there will affect requests on other threads
{code}
including the
Message.PROTOCOL_HEADERS
you set there.
So I believe
{code}
((BindingProvider)proxy).getRequestContext().put("thread.local.request.context", "true");
{code}
which can make request context threadsafe could address this issue.
Freeman
> [Apache cxf 3.1.4] ConcurrentModificationException
> --------------------------------------------------
>
> Key: CXF-8082
> URL: https://issues.apache.org/jira/browse/CXF-8082
> Project: CXF
> Issue Type: Bug
> Components: Bus
> Affects Versions: 3.1.4
> Reporter: SARE Samadou
> Priority: Blocker
>
> Scenario: we have an exception with the following stack trace in one a batch processing using spring batch. This batch use 4 concurrents thread , each of them make processiing in separate partition
> Caused by: java.util.ConcurrentModificationException: null
> at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
> at java.util.HashMap$EntryIterator.next(HashMap.java:1476)
> at java.util.HashMap$EntryIterator.next(HashMap.java:1474)
> at java.util.AbstractMap.putAll(AbstractMap.java:280)
> at java.util.TreeMap.putAll(TreeMap.java:327)
> at org.apache.cxf.transport.http.Headers.getSetProtocolHeaders(Headers.java:249)
> at org.apache.cxf.transport.http.Headers.<init>(Headers.java:90)
> at org.apache.cxf.transport.http.HTTPConduit.setHeadersByAuthorizationPolicy(HTTPConduit.java:787)
> at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:556)
> at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)