Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModificationException in ConfigurationClassParser.processDeferredImportSelectors [SPR-11997] #16613

spring-issuemaster opened this issue Jul 15, 2014 · 1 comment


None yet
2 participants
Copy link

commented Jul 15, 2014

Andy Wilkinson opened SPR-11997 and commented

I'm trying Spring Boot against the 4.1.0 snapshots and two tests that use a parent-child context hierarchy are failing with the same ConcurrentModificationException:

	at java.util.LinkedList$ListItr.checkForComodification(
	at java.util.LinkedList$
	at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(
	at org.springframework.context.annotation.ConfigurationClassParser.parse(
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(
	at org.springframework.boot.SpringApplication.refresh(
	at org.springframework.boot.actuate.autoconfigure.SpringApplicationHierarchyTests.testChild(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.junit.internal.runners.statements.RunAfters.evaluate(
	at org.junit.runners.ParentRunner.runLeaf(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.ParentRunner$
	at org.junit.runners.ParentRunner$1.schedule(
	at org.junit.runners.ParentRunner.runChildren(
	at org.junit.runners.ParentRunner.access$000(
	at org.junit.runners.ParentRunner$2.evaluate(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

The cause of the concurrent modification appears to be in processImports which is called while looping over this.deferredImportSelectors. processImports may call this.deferredImportSelectors.add() which results in the ConcurrentModificationException being thrown the next time round the loop.

Affects: 4.1 RC1

Issue Links:

  • #17436 ConcurrentModificationException in ConfigurationClassParser.processDeferredImportSelectors

Referenced from: commits bbf5800


This comment has been minimized.

Copy link
Collaborator Author

commented Jul 15, 2014

Juergen Hoeller commented

This seems to have been caused by the presence of our ViewConfigurationImportSelector which went away for other reasons in the meantime...

Nevertheless, this issue indicates a problem with any DeferredImportSelector which in turn imports another DeferredImportSelector. We're processing the latter as regular import selectors now, not adding them to that deferred List to begin with.

In the course of this, I've also refined the exception handling in ConfigurationClassParser, treating regular class loading and ASM-based loading consistently in terms of exception wrapping, and always mentioning the current configuration class in its messages.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.