java.util.ConcurrentModificationException

Spring JIRA | Spencer Gibb | 2 years ago
  1. 0

    GitHub comment 25#62807519

    GitHub | 2 years ago | spencergibb
    java.util.ConcurrentModificationException
  2. 0

    While trying to call {{PropertySourcesPropertyResolver.containsProperty}} from one thread, another thread has added a new {{PropertySource}} and then the {{ConcurrentModificationException}} is thrown. This code in Spring Boot adds the property source in a {{ContextRefreshedEvent}} handler. https://github.com/spring-projects/spring-boot/blob/master/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java#L228 {noformat} [2014-11-12 15:30:35.201] boot - 93750 ERROR [Thread-3] --- ConcurrentMapConfiguration: Error firing configuration event java.util.ConcurrentModificationException at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953) at java.util.LinkedList$ListItr.next(LinkedList.java:886) at org.springframework.core.env.PropertySourcesPropertyResolver.containsProperty(PropertySourcesPropertyResolver.java:49) at org.springframework.core.env.AbstractEnvironment.containsProperty(AbstractEnvironment.java:460) at org.springframework.cloud.netflix.archaius.ConfigurableEnvironmentConfiguration.containsKey(ConfigurableEnvironmentConfiguration.java:43) at com.netflix.config.ConcurrentCompositeConfiguration.getSource(ConcurrentCompositeConfiguration.java:864) at com.netflix.config.ConcurrentCompositeConfiguration$1.configurationChanged(ConcurrentCompositeConfiguration.java:151) at com.netflix.config.ConcurrentMapConfiguration.fireEvent(ConcurrentMapConfiguration.java:312) at com.netflix.config.ConcurrentMapConfiguration.setProperty(ConcurrentMapConfiguration.java:216) at com.netflix.config.ConcurrentCompositeConfiguration.setProperty(ConcurrentCompositeConfiguration.java:486) at com.netflix.eureka.cluster.PeerEurekaNode.getBatcher(PeerEurekaNode.java:806) at com.netflix.eureka.cluster.PeerEurekaNode.<init>(PeerEurekaNode.java:94) at com.netflix.eureka.PeerAwareInstanceRegistry.updatePeerEurekaNodes(PeerAwareInstanceRegistry.java:219) at com.netflix.eureka.PeerAwareInstanceRegistry.setupPeerEurekaNodes(PeerAwareInstanceRegistry.java:187) at com.netflix.eureka.PeerAwareInstanceRegistry.init(PeerAwareInstanceRegistry.java:156) at com.netflix.eureka.PeerAwareInstanceRegistry.<init>(PeerAwareInstanceRegistry.java:144) at com.netflix.eureka.PeerAwareInstanceRegistry.<clinit>(PeerAwareInstanceRegistry.java:130) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:174) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:156) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer$$EnhancerBySpringCGLIB$$e403e8f8.onApplicationEvent(<generated>) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1$1.initEurekaEnvironment(EurekaServerInitializerConfiguration.java:109) at com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1.run(EurekaServerInitializerConfiguration.java:100) at java.lang.Thread.run(Thread.java:744) {noformat}

    Spring JIRA | 2 years ago | Spencer Gibb
    java.util.ConcurrentModificationException
  3. 0

    While trying to call {{PropertySourcesPropertyResolver.containsProperty}} from one thread, another thread has added a new {{PropertySource}} and then the {{ConcurrentModificationException}} is thrown. This code in Spring Boot adds the property source in a {{ContextRefreshedEvent}} handler. https://github.com/spring-projects/spring-boot/blob/master/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java#L228 {noformat} [2014-11-12 15:30:35.201] boot - 93750 ERROR [Thread-3] --- ConcurrentMapConfiguration: Error firing configuration event java.util.ConcurrentModificationException at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953) at java.util.LinkedList$ListItr.next(LinkedList.java:886) at org.springframework.core.env.PropertySourcesPropertyResolver.containsProperty(PropertySourcesPropertyResolver.java:49) at org.springframework.core.env.AbstractEnvironment.containsProperty(AbstractEnvironment.java:460) at org.springframework.cloud.netflix.archaius.ConfigurableEnvironmentConfiguration.containsKey(ConfigurableEnvironmentConfiguration.java:43) at com.netflix.config.ConcurrentCompositeConfiguration.getSource(ConcurrentCompositeConfiguration.java:864) at com.netflix.config.ConcurrentCompositeConfiguration$1.configurationChanged(ConcurrentCompositeConfiguration.java:151) at com.netflix.config.ConcurrentMapConfiguration.fireEvent(ConcurrentMapConfiguration.java:312) at com.netflix.config.ConcurrentMapConfiguration.setProperty(ConcurrentMapConfiguration.java:216) at com.netflix.config.ConcurrentCompositeConfiguration.setProperty(ConcurrentCompositeConfiguration.java:486) at com.netflix.eureka.cluster.PeerEurekaNode.getBatcher(PeerEurekaNode.java:806) at com.netflix.eureka.cluster.PeerEurekaNode.<init>(PeerEurekaNode.java:94) at com.netflix.eureka.PeerAwareInstanceRegistry.updatePeerEurekaNodes(PeerAwareInstanceRegistry.java:219) at com.netflix.eureka.PeerAwareInstanceRegistry.setupPeerEurekaNodes(PeerAwareInstanceRegistry.java:187) at com.netflix.eureka.PeerAwareInstanceRegistry.init(PeerAwareInstanceRegistry.java:156) at com.netflix.eureka.PeerAwareInstanceRegistry.<init>(PeerAwareInstanceRegistry.java:144) at com.netflix.eureka.PeerAwareInstanceRegistry.<clinit>(PeerAwareInstanceRegistry.java:130) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:174) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:156) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer$$EnhancerBySpringCGLIB$$e403e8f8.onApplicationEvent(<generated>) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1$1.initEurekaEnvironment(EurekaServerInitializerConfiguration.java:109) at com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88) at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1.run(EurekaServerInitializerConfiguration.java:100) at java.lang.Thread.run(Thread.java:744) {noformat}

    Spring JIRA | 2 years ago | Spencer Gibb
    java.util.ConcurrentModificationException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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

      No message provided

      at java.util.LinkedList$ListItr.checkForComodification()
    2. Java RT
      LinkedList$ListItr.next
      1. java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953)
      2. java.util.LinkedList$ListItr.next(LinkedList.java:886)
      2 frames
    3. Spring Core
      AbstractEnvironment.containsProperty
      1. org.springframework.core.env.PropertySourcesPropertyResolver.containsProperty(PropertySourcesPropertyResolver.java:49)
      2. org.springframework.core.env.AbstractEnvironment.containsProperty(AbstractEnvironment.java:460)
      2 frames
    4. org.springframework.cloud
      ConfigurableEnvironmentConfiguration.containsKey
      1. org.springframework.cloud.netflix.archaius.ConfigurableEnvironmentConfiguration.containsKey(ConfigurableEnvironmentConfiguration.java:43)
      1 frame
    5. archaius-core
      ConcurrentCompositeConfiguration.setProperty
      1. com.netflix.config.ConcurrentCompositeConfiguration.getSource(ConcurrentCompositeConfiguration.java:864)
      2. com.netflix.config.ConcurrentCompositeConfiguration$1.configurationChanged(ConcurrentCompositeConfiguration.java:151)
      3. com.netflix.config.ConcurrentMapConfiguration.fireEvent(ConcurrentMapConfiguration.java:312)
      4. com.netflix.config.ConcurrentMapConfiguration.setProperty(ConcurrentMapConfiguration.java:216)
      5. com.netflix.config.ConcurrentCompositeConfiguration.setProperty(ConcurrentCompositeConfiguration.java:486)
      5 frames
    6. com.netflix.eureka
      PeerAwareInstanceRegistry.<clinit>
      1. com.netflix.eureka.cluster.PeerEurekaNode.getBatcher(PeerEurekaNode.java:806)
      2. com.netflix.eureka.cluster.PeerEurekaNode.<init>(PeerEurekaNode.java:94)
      3. com.netflix.eureka.PeerAwareInstanceRegistry.updatePeerEurekaNodes(PeerAwareInstanceRegistry.java:219)
      4. com.netflix.eureka.PeerAwareInstanceRegistry.setupPeerEurekaNodes(PeerAwareInstanceRegistry.java:187)
      5. com.netflix.eureka.PeerAwareInstanceRegistry.init(PeerAwareInstanceRegistry.java:156)
      6. com.netflix.eureka.PeerAwareInstanceRegistry.<init>(PeerAwareInstanceRegistry.java:144)
      7. com.netflix.eureka.PeerAwareInstanceRegistry.<clinit>(PeerAwareInstanceRegistry.java:130)
      7 frames
    7. org.springframework.cloud
      EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer$$EnhancerBySpringCGLIB$$e403e8f8.onApplicationEvent
      1. org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:174)
      2. org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer.onApplicationEvent(EurekaServerInitializerConfiguration.java:156)
      3. org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$RegistryInstanceProxyInitializer$$EnhancerBySpringCGLIB$$e403e8f8.onApplicationEvent(<generated>)
      3 frames
    8. Spring Context
      AbstractApplicationContext.publishEvent
      1. org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
      2. org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
      2 frames
    9. org.springframework.cloud
      EurekaServerInitializerConfiguration$1$1.initEurekaEnvironment
      1. org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1$1.initEurekaEnvironment(EurekaServerInitializerConfiguration.java:109)
      1 frame
    10. com.netflix.eureka
      EurekaBootStrap.contextInitialized
      1. com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88)
      1 frame
    11. org.springframework.cloud
      EurekaServerInitializerConfiguration$1.run
      1. org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1.run(EurekaServerInitializerConfiguration.java:100)
      1 frame
    12. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:744)
      1 frame