4 Replies Latest reply on Dec 17, 2013 10:44 AM by Zoltán Marić

    ConcurrentAccessException in WELD

    Zoltán Marić Newbie

      I got the following exception while running my application on JBAS015899: JBoss AS 7.1.1.Final "Brontes":

       

      Caused by: java.util.ConcurrentModificationException
              at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819) [rt.jar:1.7.0_25]
              at java.util.ArrayList$Itr.next(ArrayList.java:791) [rt.jar:1.7.0_25]
              at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:89) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:83) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:304) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.createUnderlying(EEResourceProducerField.java:149) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.access$000(EEResourceProducerField.java:54) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.builtin.ee.EEResourceProducerField$EEResourceCallable.call(EEResourceProducerField.java:74) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:46) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weldx.persistence.EntityManagerFactory$1455352503$Proxy$_$$_Weld$Proxy$.createEntityManager(EntityManagerFactory$1455352503$Proxy$_$$_Weld$Proxy$.java) [hibernate-jpa-2.0-api-1.0.1.Final.jar:]
      
      

       

      The application enqueues hundreds to thousands of runnables to be executed inside an executor with a pool of size 20. Each runnable invokes EntityManagerFactory.createEntityManager() twice (which is the line in which this exception eventually occurs).

       

      Does anyone have any information on why this may happen?

      Let me know if you need any additional information.