Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.13.1
-
None
-
Unknown
Description
There is a (small) chance of ConcurrentModificationException when creating routes dynamically.
java.util.ConcurrentModificationException at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373) at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384) at java.util.AbstractCollection.toArray(AbstractCollection.java:124) at java.util.ArrayList.<init>(ArrayList.java:131) at org.apache.camel.impl.DefaultCamelContext.getRoutes(DefaultCamelContext.java:650) at org.apache.camel.impl.DefaultCamelContext.getRoute(DefaultCamelContext.java:655)
The cause is that if you happen to be calling getRoute at the same time you are creating a new route then the internals of new ArrayList call collection.toArray which throws the error.
Attachments
Issue Links
- relates to
-
CAMEL-8673 ConcurrentModificationException when creating dynamic routes
- Resolved