[jbosstools-issues] [JBoss JIRA] (JBIDE-15616) ConcurrentModificationException in CDICoreBuilder

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Thu Oct 10 19:13:02 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-15616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12813277#comment-12813277 ] 

Viacheslav Kabanovich edited comment on JBIDE-15616 at 10/10/13 7:12 PM:
-------------------------------------------------------------------------

Loading of CDI model is implemented through build. That means that build method can be invoked from different threads, one requesting for loaded model, the other performing Eclipse's build. We had already met synchronization problems caused by concurrent access to build, and tried to solve it with improving thread safety. Now, I think, we just cannot allow for concurrent build to happen. One build should wait for the other.
                
      was (Author: scabanovich):
    Loading of CDI model is implemented through build. That means that build method can be invoked from different threads, one requesting for loaded model, the other performing Eclipse's build. We had already met synchronization problems caused by concurrent access to build, and tried to solve it with improving thread safety. Now, I think, we just cannot allow for concurrent build to happen. One build should wait for the other other.
                  
> ConcurrentModificationException in CDICoreBuilder
> -------------------------------------------------
>
>                 Key: JBIDE-15616
>                 URL: https://issues.jboss.org/browse/JBIDE-15616
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: cdi
>    Affects Versions: 4.2.0.Alpha1
>            Reporter: Alexey Kazakov
>            Assignee: Viacheslav Kabanovich
>             Fix For: 4.2.0.Alpha1
>
>
> {code}
> testSwitchingCDICapabilities(org.jboss.tools.cdi.core.test.DependentProjectTest)  Time elapsed: 0.044 sec  <<< ERROR!
> org.eclipse.core.internal.resources.ResourceException: Errors occurred during the build.
> 	at org.eclipse.core.internal.resources.Project$1.run(Project.java:620)
> 	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
> 	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
> 	at org.eclipse.core.internal.resources.Project.build(Project.java:114)
> 	at org.jboss.tools.cdi.core.test.DependentProjectTest.testSwitchingCDICapabilities(DependentProjectTest.java:338)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at junit.framework.TestCase.runTest(TestCase.java:176)
> 	at junit.framework.TestCase.runBare(TestCase.java:141)
> 	at junit.framework.TestResult$1.protect(TestResult.java:122)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.framework.TestResult.run(TestResult.java:125)
> 	at junit.framework.TestCase.run(TestCase.java:129)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:23)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.extensions.TestSetup.run(TestSetup.java:27)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> 	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> 	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> 	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
> 	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
> 	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:35)
> 	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> 	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
> 	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3717)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3366)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> 	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
> 	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31)
> 	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:114)
> 	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37)
> 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Contains: Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'CDITest2'.
> java.util.ConcurrentModificationException
> 	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:926)
> 	at java.util.HashMap$KeyIterator.next(HashMap.java:960)
> 	at org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext.copy(DefinitionContext.java:85)
> 	at org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext.newWorkingCopy(DefinitionContext.java:359)
> 	at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:204)
> 	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
> 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
> 	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
> 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
> 	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
> 	at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
> 	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
> 	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
> 	at org.eclipse.core.internal.resources.Project.build(Project.java:114)
> 	at org.jboss.tools.cdi.core.test.DependentProjectTest.testSwitchingCDICapabilities(DependentProjectTest.java:338)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at junit.framework.TestCase.runTest(TestCase.java:176)
> 	at junit.framework.TestCase.runBare(TestCase.java:141)
> 	at junit.framework.TestResult$1.protect(TestResult.java:122)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.framework.TestResult.run(TestResult.java:125)
> 	at junit.framework.TestCase.run(TestCase.java:129)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:23)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
> 	at junit.framework.TestResult.runProtected(TestResult.java:142)
> 	at junit.extensions.TestSetup.run(TestSetup.java:27)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:255)
> 	at junit.framework.TestSuite.run(TestSuite.java:250)
> 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> 	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> 	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> 	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
> 	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
> 	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:35)
> 	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> 	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
> 	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3717)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3366)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> 	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
> 	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31)
> 	at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:114)
> 	at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37)
> 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list