Closed
Description
Using quartz 2.3.1 I get the following exception occasionally on startup of a webapp in Tomcat.
java.util.ConcurrentModificationException
at java.util.Hashtable$Enumerator.next(Hashtable.java:1387)
at java.util.Hashtable.putAll(Hashtable.java:523)
at org.quartz.impl.StdSchedulerFactory.overrideWithSysProps(StdSchedulerFactory.java:495)
at org.quartz.impl.StdSchedulerFactory.initialize(StdSchedulerFactory.java:472)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1552)
This is due to StdSchedulerFactory.overrideWithSysProps
which looks like this:
quartz/quartz-core/src/main/java/org/quartz/impl/StdSchedulerFactory.java
Lines 475 to 496 in 1ba8447
By calling putAll
the entrySet()
iterator is used on System.getProperties()
which is not a thread-safe way of traversing System properties.
The fix would be to instead traverse the System properties by using the Enumeration propertyNames()
and calling getProperty
on each property name.
Happy to provide PR.
CC @SuperEventSteven
Metadata
Metadata
Assignees
Labels
No labels
Activity