Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 141C9D629 for ; Mon, 9 Jul 2012 16:13:36 +0000 (UTC) Received: (qmail 34078 invoked by uid 500); 9 Jul 2012 16:13:35 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 33994 invoked by uid 500); 9 Jul 2012 16:13:35 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 33806 invoked by uid 99); 9 Jul 2012 16:13:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2012 16:13:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 2378F140541 for ; Mon, 9 Jul 2012 16:13:35 +0000 (UTC) Date: Mon, 9 Jul 2012 16:13:35 +0000 (UTC) From: "Gary Mulder (JIRA)" To: issues@cxf.apache.org Message-ID: <420531752.23687.1341850415147.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Comment Edited] (CXF-2835) ConcurrentModificationException in ClientImpl caused by toString-method on requestContext MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409597#comment-13409597 ] Gary Mulder edited comment on CXF-2835 at 7/9/12 4:13 PM: ---------------------------------------------------------- We seem to be intermittently reproducing this issue with 2.2.9, so it doesn't seem to be fixed. Caused by: javax.xml.ws.soap.SOAPFaultException: Fault string, and possibly fault code, not set at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) at $Proxy64.debitFunds(Unknown Source) at com.betfair.services.payments.serviceclients.funds.FundsClient.debitFunds(FundsClient.java:76) at com.betfair.services.payments.serviceclients.funds.FundsClient$$FastClassByCGLIB$$8a3af175.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77) at com.betfair.monitoring.kpi.aop.KPIMeasuringAspect.measureDuration(KPIMeasuringAspect.java:67) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77) at com.betfair.monitoring.kpi.aop.KPIMeasuringAspect.measureDuration(KPIMeasuringAspect.java:67) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ... 10 more Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$EntryIterator.next(HashMap.java:834) at java.util.HashMap$EntryIterator.next(HashMap.java:832) at java.util.AbstractMap.toString(AbstractMap.java:485) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at java.util.AbstractMap.toString(AbstractMap.java:490) at java.util.Collections$SynchronizedMap.toString(Collections.java:2026) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at org.apache.cxf.endpoint.ClientImpl.processResult(ClientImpl.java:563) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) ... 52 more was (Author: flyingkiwiguy): We seem to be intermittently reproducing this issue with 2.2.9, so it doesn't seem to be fixed. Caused by: javax.xml.ws.soap.SOAPFaultException: Fault string, and possibly fault code, not set at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) at $Proxy64.debitFunds(Unknown Source) at com.betfair.services.payments.serviceclients.funds.FundsClient.debitFunds(FundsClient.java:76) at com.betfair.services.payments.serviceclients.funds.FundsClient$$FastClassByCGLIB$$8a3af175.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77) at com.betfair.monitoring.kpi.aop.KPIMeasuringAspect.measureDuration(KPIMeasuringAspect.java:67) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at com.betfair.services.payments.serviceclients.funds.FundsClient$$EnhancerByCGLIB$$5c46a949.debitFunds() at com.betfair.payments.paymentservice.banktransfer.fundstransfer.FundsTransferHandlerImpl.debitFunds(FundsTransferHandlerImpl.java:91) at com.betfair.payments.paymentservice.banktransfer.fundstransfer.FundsTransferHandlerImpl.makeWithdrawal(FundsTransferHandlerImpl.java:58) at com.betfair.payments.paymentservice.banktransfer.BankTransferHandlerImpl.makeWithdrawal(BankTransferHandlerImpl.java:43) at com.betfair.services.payments.dispatcher.BankTransferDispatcher.dispatch(BankTransferDispatcher.java:48) at com.betfair.services.payments.ConsolePaymentsFacadeServiceImpl.dispatchPaymentRequest(ConsolePaymentsFacadeServiceImpl.java:144) at com.betfair.services.payments.ConsolePaymentsFacadeServiceImpl.processPayment(ConsolePaymentsFacadeServiceImpl.java:96) at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77) at com.betfair.monitoring.kpi.aop.KPIMeasuringAspect.measureDuration(KPIMeasuringAspect.java:67) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.processPayment(Unknown Source) at com.betfair.regpay.services.payments.v1_0.ConsolePaymentsFacadeSyncServiceExecutableResolver$2.execute(ConsolePaymentsFacadeSyncServiceExecutableResolver.java:60) at com.betfair.cougar.core.impl.ev.ServiceExecutableResolver$RequestContextExecutable.execute(ServiceExecutableResolver.java:75) at com.betfair.cougar.core.impl.ev.InterceptingExecutableWrapper.execute(InterceptingExecutableWrapper.java:43) ... 5 more Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$EntryIterator.next(HashMap.java:834) at java.util.HashMap$EntryIterator.next(HashMap.java:832) at java.util.AbstractMap.toString(AbstractMap.java:485) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at java.util.AbstractMap.toString(AbstractMap.java:490) at java.util.Collections$SynchronizedMap.toString(Collections.java:2026) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at org.apache.cxf.endpoint.ClientImpl.processResult(ClientImpl.java:563) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) ... 52 more > ConcurrentModificationException in ClientImpl caused by toString-method on requestContext > ----------------------------------------------------------------------------------------- > > Key: CXF-2835 > URL: https://issues.apache.org/jira/browse/CXF-2835 > Project: CXF > Issue Type: Bug > Affects Versions: 2.2.6 > Reporter: Henning Jensen > Assignee: Daniel Kulp > Fix For: 2.2.9 > > > We have about 10 threads running at the same time against the same web service. Some of the requests fail with the following stacktrace: > {code} > javax.xml.ws.soap.SOAPFaultException: Fault string, and possibly fault code, not set > at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) > at $Proxy218.getFlightData(Unknown Source) > at com.example.FlightDataAction.run(FlightDataAction.java:94) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.util.ConcurrentModificationException > at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) > at java.util.HashMap$EntryIterator.next(HashMap.java:834) > at java.util.HashMap$EntryIterator.next(HashMap.java:832) > at java.util.AbstractMap.toString(AbstractMap.java:485) > at java.lang.String.valueOf(String.java:2826) > at java.lang.StringBuilder.append(StringBuilder.java:115) > at java.util.AbstractMap.toString(AbstractMap.java:490) > at java.util.Collections$SynchronizedMap.toString(Collections.java:2026) > at java.lang.String.valueOf(String.java:2826) > at java.lang.StringBuilder.append(StringBuilder.java:115) > at org.apache.cxf.endpoint.ClientImpl.processResult(ClientImpl.java:535) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:486) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:262) > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) > at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) > ... 5 more > {code} > From ClientImpl: > {code} > protected Map> responseContext > = Collections.synchronizedMap(new WeakHashMap>()); > .... > protected Object[] processResult(Message message, > Exchange exchange, > BindingOperationInfo oi, > Map resContext) throws Exception { > .... > // Grab the response objects if there are any > List resList = null; > Message inMsg = exchange.getInMessage(); > if (inMsg != null) { > if (null != resContext) { > resContext.putAll(inMsg); > if (LOG.isLoggable(Level.FINE)) { > LOG.fine("set responseContext to be" + responseContext); > } > } > resList = inMsg.getContent(List.class); > } > ... > {code} > The use of toString on responseContext is causing a ConcurrentModificationException when there are many threads working at the same time on the same service. The LOG.fine -line is not optimal since the string is actually resolved no matter if the log line is going to be written to the log file or not. Using String.format() would fix the issue when log level is not FINE, but would not fix the actual problem caused by many threads at the same time. I'm not sure what the developer wish to log in this cause, but limiting the object traversal and not using toString should do the trick. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira