Seeing ConcurrentModificationException occasionally when deploying RESTEasy application in JBoss EAP 6
Issue
- During server startup, while multiple artifacts are being deployed in parallel by the server, a ConcurrentModificationException occurs that prevents an artifact from being correctly deployed :
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/test-app]] (ServerService Thread Pool -- 45) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY001795: Unable to instantiate MessageBodyReader
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:32) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:219) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.5.Final-redhat-3.jar:7.5.5.Final-redhat-3]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.RuntimeException: RESTEASY001795: Unable to instantiate MessageBodyReader
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:837) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:67) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:28) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
... 13 more
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList.sort(ArrayList.java:1456) [rt.jar:1.8.0_45]
at java.util.Collections.sort(Collections.java:141) [rt.jar:1.8.0_45]
at org.jboss.resteasy.core.MediaTypeMap.add(MediaTypeMap.java:281) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:518) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:480) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:833) [resteasy-jaxrs-2.3.12.Final-redhat-1.jar:]
... 15 more
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
