Title: Message
(Sorry previous message escaped prematurely then I hit CTRL-V).
 
It's basically the same except line numbers:
 
 
2002-10-10 11:31:33,408,STDERR java.util.ConcurrentModificationException
2002-10-10 11:31:33,408,STDERR  at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
2002-10-10 11:31:33,408,STDERR  at java.util.HashMap$KeyIterator.next(HashMap.java:798)
2002-10-10 11:31:33,408,STDERR  at org.jboss.mx.loading.UnifiedLoaderRepository2.getResourceFromRepository(UnifiedLoaderRepository2.java:823)
2002-10-10 11:31:33,408,STDERR  at org.jboss.mx.loading.UnifiedLoaderRepository2.getResource(UnifiedLoaderRepository2.java:705)
2002-10-10 11:31:33,408,STDERR  at org.jboss.mx.loading.UnifiedClassLoader.getResource(UnifiedClassLoader.java:296)
2002-10-10 11:31:33,408,STDERR  at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:941)
2002-10-10 11:31:33,408,STDERR  at java.lang.Class.getResourceAsStream(Class.java:1298)
2002-10-10 11:31:33,408,STDERR  at javax.mail.SecuritySupport12$2.run(SecuritySupport12.java:41)
2002-10-10 11:31:33,408,STDERR  at java.security.AccessController.doPrivileged(Native Method)
2002-10-10 11:31:33,408,STDERR  at javax.mail.SecuritySupport12.getResourceAsStream(SecuritySupport12.java:39)
2002-10-10 11:31:33,418,STDERR  at javax.mail.Session.loadResource(Session.java:1029)
2002-10-10 11:31:33,418,STDERR  at javax.mail.Session.loadAllResources(Session.java:1109)
2002-10-10 11:31:33,418,STDERR  at javax.mail.Session.loadAddressMap(Session.java:974)
2002-10-10 11:31:33,418,STDERR  at javax.mail.Session.<init>(Session.java:189)
2002-10-10 11:31:33,418,STDERR  at javax.mail.Session.getInstance(Session.java:210)
2002-10-10 11:31:33,418,STDERR  at org.apache.james.transport.mailets.RemoteDelivery.run(Unknown Source)
2002-10-10 11:31:33,418,STDERR  at java.lang.Thread.run(Thread.java:536)
 
Regards
Steve
-----Original Message-----
From: Scott M Stark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 11:14 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] Possible Synchronization Issue in UnifiedLoaderRepository2

Show the stack trace then.
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Thursday, October 10, 2002 10:52 AM
Subject: RE: [JBoss-dev] Possible Synchronization Issue in UnifiedLoaderRepository2

This doesn't fix it.  I checked out Branch_3_0 this morning, built it and re ran my test and I still get the ConcurrentModificationException.
 
Regards
Steve
 
-----Original Message-----
From: Scott M Stark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 9:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] Possible Synchronization Issue in UnifiedLoaderRepository2

I have ported the recent 3.2 class loader synch fixes to 3.0. In general class loading
cannot synch on the loader as it leads deadlock. Resource lookups could probably
synch on the resource map as I don't think it can induce class loading, but for now
it synchs on the repository class.
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Wednesday, October 09, 2002 1:29 PM
Subject: [JBoss-dev] Possible Synchronization Issue in UnifiedLoaderRepository2

Hi folks,

I am running the Jakarta James mail server in Jboss_3.0.2 and I'm frequently seeing ConcurrentModificationExceptions in the UnifiedLoaderRepository2 while Javamail is attempting to load it's protocol provider and address map properties files.  The full exception is:

    java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
        at java.util.HashMap$KeyIterator.next(HashMap.java:798)
        at org.jboss.mx.loading.UnifiedLoaderRepository2.getResourceFromRepository(UnifiedLoaderRepository2.java:344)
        at org.jboss.mx.loading.UnifiedLoaderRepository2.getResource(UnifiedLoaderRepository2.java:295)
        at org.jboss.mx.loading.UnifiedClassLoader.getResource(UnifiedClassLoader.java:296)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:941)
        at java.lang.Class.getResourceAsStream(Class.java:1298)
        at javax.mail.Session.loadProviders(Session.java:771)
        at javax.mail.Session.<init>(Session.java:81)
        at javax.mail.Session.getInstance(Session.java:103)
        at org.apache.james.transport.mailets.RemoteDelivery.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536

I've taken a quick look at the UnifiedLoaderRepository2.java source file and it looks like there's something amiss with the synchronization around the classloader HashSets and their iterators.  Here's what the key methods do:

  - loadClassFromRepository has no synchronization.
  - getResourceFromRepository has no synchronization.
  - getURLs synchronizes on the object instance (this).
  - addClassLoader synchronizes at the class level (UnifiedLoaderRepository2.class)
  - removeClassLoader synchronizes at the class level (UnifiedLoaderRepository2.class)
  - findClass synchronizes on the object instance (this).

When I change them all to synchronize on the object instance, everything seems to work OK.

Steve

Reply via email to