java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main]

Apache's JIRA Issue Tracker | pawan bhole | 7 years ago
  1. 0

    i am creating locators only once and storing those in HashMap. And at every service call (by multiple threads parallely) I am just retriving locators from HashMap and using those for creating methode call. Code: public class WsClientRetriever { protected final Log log = LogFactory.getLog(getClass()); protected final HashMap<Class<? extends Service>,Object> servicesMapCache = new HashMap<Class<? extends Service>, Object>(); /** * The url for the services */ private String rootUrl; /** * This generic method will return the WebService class using the given web service locator class * @param serviceLocatorClass * @return * @throws ServiceRetrievalException if the service could not be retrieved in any ways */ public synchronized Object getWebService(Class<? extends Service> serviceLocatorClass) throws ServiceRetrievalException { Object locator = servicesMapCache.get(serviceLocatorClass); Object result = null; // it's not in our cache, we have to get it using reflexion try { if (locator == null) { locator = serviceLocatorClass.newInstance(); servicesMapCache.put(serviceLocatorClass, locator); } Method[] methods = serviceLocatorClass.getMethods(); // we look for the method that needs an URL as parameter and starts with get for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get") && (method.getParameterTypes().length == 1) && (method.getParameterTypes()[0] == URL.class)){ // we found it, we need to call it result = method.invoke(locator, getWSURL(serviceLocatorClass)); } } } catch (Exception e) { throw new ServiceRetrievalException(serviceLocatorClass, e); } // now we are sure to have it return result; } /** * Creates the URL to access the web service * @param serviceLocatorClass service locator class name * @return URL of the service where deployed */ private URL getWSURL(Class<? extends Service> serviceLocatorClass) { String slClassName = serviceLocatorClass.getName(); String serviceClassName = slClassName.substring(slClassName.lastIndexOf('.') + 1, slClassName.lastIndexOf("ServiceLocator")); String serviceURLString = rootUrl + serviceClassName; URL serviceURL = null; try { serviceURL = new URL(serviceURLString); return serviceURL; } catch (MalformedURLException e) { log.debug("caught an exception", e); throw new WebServiceRetrievalException(serviceURLString, e); } } /** * @param rootUrl the rootUrl to set */ public void setRootUrl(String rootUrl) { this.rootUrl = rootUrl; if (this.rootUrl != null && !this.rootUrl.endsWith("/")) { this.rootUrl += "/"; } } } ********************************************************************************************************************************* stack trace : [8/13/09 16:55:21:077 IST] 00000026 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(ProPayEAR#ProPayEJB-1.2-ENGINE-SPR7-IT1-SNAPSHOT.jar#MessageProcessor, null)". Exception data: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:96) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132) at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:492) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497) Caused by: java.lang.RuntimeException: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:62) at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:302) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63) at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:271) at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:240) at com.ibm.mq.jms.MQSession.run(MQSession.java:1691) at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:975) at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:957) at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:667) at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:634) ... 9 more Caused by: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:75) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.assignCreditMechanism(CreditMechanismHelperWsImpl.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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.assignCreditMechanism(Unknown Source) at com.te.jpay.backendintegration.tietoapps.jdir.JDirectoryClientImpl.assignCreditMechanism(JDirectoryClientImpl.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy76.assignCreditMechanism(Unknown Source) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.performGroupLevelProcessing(InwardDDCollectionReceiverImpl.java:110) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.doBusinessLogic(InwardDDCollectionReceiverImpl.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy77.doBusinessLogic(Unknown Source) at com.te.jpay.dispatch.DefaultPaymentDispatcher.dispatchMessageFromBulker(DefaultPaymentDispatcher.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy78.dispatchMessageFromBulker(Unknown Source) at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:49) ... 18 more Caused by: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:384) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.getMechanismParameterByCodeword(MechanismWSSoapBindingStub.java:460) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:73) ... 108 more Caused by: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at java.util.HashMap.onExit(HashMap.java:226) at java.util.HashMap.transfer(HashMap.java:690) at java.util.HashMap.resize(HashMap.java:676) at java.util.HashMap.addEntry(HashMap.java:1049) at java.util.HashMap.put(HashMap.java:561) at org.apache.axis.encoding.TypeMappingImpl.internalRegister(TypeMappingImpl.java:263) at org.apache.axis.encoding.TypeMappingImpl.register(TypeMappingImpl.java:221) at org.apache.axis.encoding.TypeMappingDelegate.register(TypeMappingDelegate.java:73) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2285) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2322) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:369) ... 110 more

    Apache's JIRA Issue Tracker | 7 years ago | pawan bhole
    java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main]
  2. 0

    i am creating locators only once and storing those in HashMap. And at every service call (by multiple threads parallely) I am just retriving locators from HashMap and using those for creating methode call. Code: public class WsClientRetriever { protected final Log log = LogFactory.getLog(getClass()); protected final HashMap<Class<? extends Service>,Object> servicesMapCache = new HashMap<Class<? extends Service>, Object>(); /** * The url for the services */ private String rootUrl; /** * This generic method will return the WebService class using the given web service locator class * @param serviceLocatorClass * @return * @throws ServiceRetrievalException if the service could not be retrieved in any ways */ public synchronized Object getWebService(Class<? extends Service> serviceLocatorClass) throws ServiceRetrievalException { Object locator = servicesMapCache.get(serviceLocatorClass); Object result = null; // it's not in our cache, we have to get it using reflexion try { if (locator == null) { locator = serviceLocatorClass.newInstance(); servicesMapCache.put(serviceLocatorClass, locator); } Method[] methods = serviceLocatorClass.getMethods(); // we look for the method that needs an URL as parameter and starts with get for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get") && (method.getParameterTypes().length == 1) && (method.getParameterTypes()[0] == URL.class)){ // we found it, we need to call it result = method.invoke(locator, getWSURL(serviceLocatorClass)); } } } catch (Exception e) { throw new ServiceRetrievalException(serviceLocatorClass, e); } // now we are sure to have it return result; } /** * Creates the URL to access the web service * @param serviceLocatorClass service locator class name * @return URL of the service where deployed */ private URL getWSURL(Class<? extends Service> serviceLocatorClass) { String slClassName = serviceLocatorClass.getName(); String serviceClassName = slClassName.substring(slClassName.lastIndexOf('.') + 1, slClassName.lastIndexOf("ServiceLocator")); String serviceURLString = rootUrl + serviceClassName; URL serviceURL = null; try { serviceURL = new URL(serviceURLString); return serviceURL; } catch (MalformedURLException e) { log.debug("caught an exception", e); throw new WebServiceRetrievalException(serviceURLString, e); } } /** * @param rootUrl the rootUrl to set */ public void setRootUrl(String rootUrl) { this.rootUrl = rootUrl; if (this.rootUrl != null && !this.rootUrl.endsWith("/")) { this.rootUrl += "/"; } } } ********************************************************************************************************************************* stack trace : [8/13/09 16:55:21:077 IST] 00000026 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(ProPayEAR#ProPayEJB-1.2-ENGINE-SPR7-IT1-SNAPSHOT.jar#MessageProcessor, null)". Exception data: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:96) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132) at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:492) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497) Caused by: java.lang.RuntimeException: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:62) at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:302) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63) at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:271) at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:240) at com.ibm.mq.jms.MQSession.run(MQSession.java:1691) at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:975) at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:957) at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:667) at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:634) ... 9 more Caused by: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:75) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.assignCreditMechanism(CreditMechanismHelperWsImpl.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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.assignCreditMechanism(Unknown Source) at com.te.jpay.backendintegration.tietoapps.jdir.JDirectoryClientImpl.assignCreditMechanism(JDirectoryClientImpl.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy76.assignCreditMechanism(Unknown Source) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.performGroupLevelProcessing(InwardDDCollectionReceiverImpl.java:110) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.doBusinessLogic(InwardDDCollectionReceiverImpl.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy77.doBusinessLogic(Unknown Source) at com.te.jpay.dispatch.DefaultPaymentDispatcher.dispatchMessageFromBulker(DefaultPaymentDispatcher.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy78.dispatchMessageFromBulker(Unknown Source) at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:49) ... 18 more Caused by: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:384) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.getMechanismParameterByCodeword(MechanismWSSoapBindingStub.java:460) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:73) ... 108 more Caused by: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at java.util.HashMap.onExit(HashMap.java:226) at java.util.HashMap.transfer(HashMap.java:690) at java.util.HashMap.resize(HashMap.java:676) at java.util.HashMap.addEntry(HashMap.java:1049) at java.util.HashMap.put(HashMap.java:561) at org.apache.axis.encoding.TypeMappingImpl.internalRegister(TypeMappingImpl.java:263) at org.apache.axis.encoding.TypeMappingImpl.register(TypeMappingImpl.java:221) at org.apache.axis.encoding.TypeMappingDelegate.register(TypeMappingDelegate.java:73) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2285) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2322) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:369) ... 110 more

    Apache's JIRA Issue Tracker | 7 years ago | pawan bhole
    java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main]
  3. 0

    i am creating locators only once and storing those in HashMap. And at every service call (by multiple threads parallely) I am just retriving locators from HashMap and using those for creating methode call. Code: public class WsClientRetriever { protected final Log log = LogFactory.getLog(getClass()); protected final HashMap<Class<? extends Service>,Object> servicesMapCache = new HashMap<Class<? extends Service>, Object>(); /** * The url for the services */ private String rootUrl; /** * This generic method will return the WebService class using the given web service locator class * @param serviceLocatorClass * @return * @throws ServiceRetrievalException if the service could not be retrieved in any ways */ public synchronized Object getWebService(Class<? extends Service> serviceLocatorClass) throws ServiceRetrievalException { Object locator = servicesMapCache.get(serviceLocatorClass); Object result = null; // it's not in our cache, we have to get it using reflexion try { if (locator == null) { locator = serviceLocatorClass.newInstance(); servicesMapCache.put(serviceLocatorClass, locator); } Method[] methods = serviceLocatorClass.getMethods(); // we look for the method that needs an URL as parameter and starts with get for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get") && (method.getParameterTypes().length == 1) && (method.getParameterTypes()[0] == URL.class)){ // we found it, we need to call it result = method.invoke(locator, getWSURL(serviceLocatorClass)); } } } catch (Exception e) { throw new ServiceRetrievalException(serviceLocatorClass, e); } // now we are sure to have it return result; } /** * Creates the URL to access the web service * @param serviceLocatorClass service locator class name * @return URL of the service where deployed */ private URL getWSURL(Class<? extends Service> serviceLocatorClass) { String slClassName = serviceLocatorClass.getName(); String serviceClassName = slClassName.substring(slClassName.lastIndexOf('.') + 1, slClassName.lastIndexOf("ServiceLocator")); String serviceURLString = rootUrl + serviceClassName; URL serviceURL = null; try { serviceURL = new URL(serviceURLString); return serviceURL; } catch (MalformedURLException e) { log.debug("caught an exception", e); throw new WebServiceRetrievalException(serviceURLString, e); } } /** * @param rootUrl the rootUrl to set */ public void setRootUrl(String rootUrl) { this.rootUrl = rootUrl; if (this.rootUrl != null && !this.rootUrl.endsWith("/")) { this.rootUrl += "/"; } } } ********************************************************************************************************************************* stack trace : [8/13/09 16:55:21:077 IST] 00000026 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(ProPayEAR#ProPayEJB-1.2-ENGINE-SPR7-IT1-SNAPSHOT.jar#MessageProcessor, null)". Exception data: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:96) at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132) at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:492) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497) Caused by: java.lang.RuntimeException: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:62) at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:302) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63) at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:271) at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:240) at com.ibm.mq.jms.MQSession.run(MQSession.java:1691) at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:975) at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:957) at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:667) at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:634) ... 9 more Caused by: com.te.jpay.exception.EnvironmentalException: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:75) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.assignCreditMechanism(CreditMechanismHelperWsImpl.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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.assignCreditMechanism(Unknown Source) at com.te.jpay.backendintegration.tietoapps.jdir.JDirectoryClientImpl.assignCreditMechanism(JDirectoryClientImpl.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy76.assignCreditMechanism(Unknown Source) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.performGroupLevelProcessing(InwardDDCollectionReceiverImpl.java:110) at com.te.jpay.processing.InwardDDCollectionReceiverImpl.doBusinessLogic(InwardDDCollectionReceiverImpl.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy77.doBusinessLogic(Unknown Source) at com.te.jpay.dispatch.DefaultPaymentDispatcher.dispatchMessageFromBulker(DefaultPaymentDispatcher.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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 $Proxy78.dispatchMessageFromBulker(Unknown Source) at com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:49) ... 18 more Caused by: Failure trying to get the Call object; nested exception is: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:384) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.getMechanismParameterByCodeword(MechanismWSSoapBindingStub.java:460) at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:73) ... 108 more Caused by: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main] at java.util.HashMap.onExit(HashMap.java:226) at java.util.HashMap.transfer(HashMap.java:690) at java.util.HashMap.resize(HashMap.java:676) at java.util.HashMap.addEntry(HashMap.java:1049) at java.util.HashMap.put(HashMap.java:561) at org.apache.axis.encoding.TypeMappingImpl.internalRegister(TypeMappingImpl.java:263) at org.apache.axis.encoding.TypeMappingImpl.register(TypeMappingImpl.java:221) at org.apache.axis.encoding.TypeMappingDelegate.register(TypeMappingDelegate.java:73) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2285) at org.apache.axis.client.Call.registerTypeMapping(Call.java:2322) at com.te.prodirectory.ws.client.mechanism.MechanismWSSoapBindingStub.createCall(MechanismWSSoapBindingStub.java:369) ... 110 more

    Apache's JIRA Issue Tracker | 7 years ago | pawan bhole
    java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ConcurrentModificationException from org.eclipse.jdt.internal.core.builder.NameEnvironment

    Eclipse Bugzilla | 10 years ago | balakuma
    java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[Worker-0,5,main]
  6. 0

    ConcurrentModificationException in load test

    soapui | 7 years ago | afloom
    java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread\[xxxxxx xxx ThreadIndex = 0,5,main\]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.ConcurrentModificationException

      concurrent access to HashMap attempted by Thread[MessageListenerThreadPool : 0,5,main]

      at com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism()
    2. com.te.jpay
      CreditMechanismHelperWsImpl.assignCreditMechanism
      1. com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.getCreditMechanism(CreditMechanismHelperWsImpl.java:75)
      2. com.te.jpay.backendintegration.tietoapps.jdir.CreditMechanismHelperWsImpl.assignCreditMechanism(CreditMechanismHelperWsImpl.java:101)
      2 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    4. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      4 frames
    5. Perf4J
      AbstractTimingAspect.doPerfLogging
      1. org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    7. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
      5. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      6. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      7. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      7 frames
    8. Unknown
      $Proxy73.assignCreditMechanism
      1. $Proxy73.assignCreditMechanism(Unknown Source)
      1 frame
    9. com.te.jpay
      JDirectoryClientImpl.assignCreditMechanism
      1. com.te.jpay.backendintegration.tietoapps.jdir.JDirectoryClientImpl.assignCreditMechanism(JDirectoryClientImpl.java:123)
      1 frame
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    11. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      4 frames
    12. Perf4J
      AbstractTimingAspect.doPerfLogging
      1. org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69)
      1 frame
    13. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    14. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
      5. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      6. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      7. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      7 frames
    15. Unknown
      $Proxy76.assignCreditMechanism
      1. $Proxy76.assignCreditMechanism(Unknown Source)
      1 frame
    16. com.te.jpay
      InwardDDCollectionReceiverImpl.doBusinessLogic
      1. com.te.jpay.processing.InwardDDCollectionReceiverImpl.performGroupLevelProcessing(InwardDDCollectionReceiverImpl.java:110)
      2. com.te.jpay.processing.InwardDDCollectionReceiverImpl.doBusinessLogic(InwardDDCollectionReceiverImpl.java:64)
      2 frames
    17. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    18. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      4 frames
    19. Perf4J
      AbstractTimingAspect.doPerfLogging
      1. org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69)
      1 frame
    20. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    21. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
      5. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      6. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      7. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      7 frames
    22. Unknown
      $Proxy77.doBusinessLogic
      1. $Proxy77.doBusinessLogic(Unknown Source)
      1 frame
    23. com.te.jpay
      DefaultPaymentDispatcher.dispatchMessageFromBulker
      1. com.te.jpay.dispatch.DefaultPaymentDispatcher.dispatchMessageFromBulker(DefaultPaymentDispatcher.java:108)
      1 frame
    24. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    25. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      4 frames
    26. Perf4J
      AbstractTimingAspect.doPerfLogging
      1. org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:69)
      1 frame
    27. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:618)
      4 frames
    28. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
      5. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      6. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      7. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      7 frames
    29. Unknown
      $Proxy78.dispatchMessageFromBulker
      1. $Proxy78.dispatchMessageFromBulker(Unknown Source)
      1 frame
    30. com.te.jpay
      MessagesProcessorBean.onMessage
      1. com.te.jpay.ejb.messagesreceiver.MessagesProcessorBean.onMessage(MessagesProcessorBean.java:49)
      1 frame