4 Replies Latest reply on Jan 17, 2011 9:02 AM by Joshua Davis

    ConcurrentModificationException in Seam unit tests with Embedded JBoss

    Joshua Davis Expert

      I know this is not the best forum for this post, but I figured I'd see if anyone knew of a good workaround.


      I've been getting ConcurrentModificationException almost every time when running unit tests in Embedded JBoss beta3.SP5.  It looks like it comes from Domain in JBoss AOP.   Someone suggested a workaround to undeploy/redeploy until it works, however this actually doesn't work because the MDBs don't deploy the second time.


      Here is the stack trace:



      java.util.ConcurrentModificationException
           at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:365)
           at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:384)
           at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:383)
           at java.util.HashMap.putAllForCreate(HashMap.java:481)
           at java.util.HashMap.<init>(HashMap.java:219)
           at java.util.LinkedHashMap.<init>(LinkedHashMap.java:192)
           at org.jboss.aop.Domain.getBindings(Domain.java:137)
           at org.jboss.aop.Domain.getBindings(Domain.java:137)
           at org.jboss.aop.ReflectiveAspectBinder.bindMethodAdvice(ReflectiveAspectBinder.java:216)
           at org.jboss.aop.ReflectiveAspectBinder.bindMethodAdvices(ReflectiveAspectBinder.java:172)
           at org.jboss.aop.ReflectiveAspectBinder.getAspects(ReflectiveAspectBinder.java:90)
           at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuild
      er.java:96)
           at org.jboss.classadapter.plugins.BasicClassAdapter.getDependencies(BasicClassAdapter.java:79)
           at org.jboss.beans.info.plugins.AbstractBeanInfo.getDependencies(AbstractBeanInfo.java:210)
           at org.jboss.kernel.plugins.dependency.DescribeAction.installActionInternal(DescribeAction.java:54)
      
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelController
      ContextAction.java:197)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContex
      tAction.java:136)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextA
      ctions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:23
      3)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
           at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.ja
      va:84)
           at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.ja
      va:78)
           at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:141)
           at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:290)
           at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:335)
           at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:54)
           at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.
      java:52)
           at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:170)
           at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:592)
           at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:476)
           at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:406)
           at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128)
      



      Anyone have a better workaround?   I'm trying to see if I can just patch org.jboss.aop.Domain, but I can't figure out how to get that into the embedded jboss jars or even where to get the source code.