-
Bug
-
Resolution: Obsolete
-
Major
-
JBossAS-4.2.3.GA
-
None
The UnifiedLoaderRepository3 has an internal packagesMap
which is currently a
ConcurrentHashMap<String, TreeSet<UnfiedClassLoader>>
where the TreeSet uses a comparator based on the PkgClassLoader/UnifiedClassLoader order.
This TreeSet is not properly synchronized against changes, e.g. (un)deployment of a classloader that
has a certain package while somebody is trying to load a class from that package.
This can lead to a
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$KeyIterator.next(HashMap.java:877)
at java.util.AbstractCollection.addAll(AbstractCollection.java:318)
at java.util.TreeSet.addAll(TreeSet.java:258)
at org.jboss.mx.loading.UnifiedLoaderRepository3.getPackageClassLoaders(UnifiedLoaderRepository3.java:246)
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:178)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
Rather than synchronizing the TreeSet, I'd suggest using a CopyOnWriteList whose
contents are presorted like the TreeSet.
- is incorporated by
-
JBPAPP-1602 JBAS-6381: ConcurrentModification in UnifiedLoaderRepository3 packagesMap
- Resolved