hi martijn

On 1/19/07, Stefan Guggisberg <[EMAIL PROTECTED]> wrote:
hi martijn

On 1/19/07, Martijn Hendriks <[EMAIL PROTECTED]> wrote:
> Hi,
>
> During the registration of a set of nodetypes I encountered this
> exception:
>
> java.util.ConcurrentModificationException
>         at
> org.apache.commons.collections.map.AbstractReferenceMap$ReferenceEntrySe
> tIterator.checkMod(AbstractReferenceMap.java:761)
>         at
> org.apache.commons.collections.map.AbstractReferenceMap$ReferenceEntrySe
> tIterator.hasNext(AbstractReferenceMap.java:735)
>         at
> org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.notifyRegistered(No
> deTypeRegistry.java:1750)
>         at
> org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.registerNodeTypes(N
> odeTypeRegistry.java:223)
>
> It seems that the copying of the listeners triggered this exception:
>
>     private void notifyRegistered(QName ntName) {
>         // copy listeners to array to avoid
> ConcurrentModificationException
>         NodeTypeRegistryListener[] la =
>                 new NodeTypeRegistryListener[listeners.size()];
>         Iterator iter = listeners.values().iterator();
>         int cnt = 0;
> 1750:   while (iter.hasNext()) {
>             la[cnt++] = (NodeTypeRegistryListener) iter.next();
>         }
>         for (int i = 0; i < la.length; i++) {
>             if (la[i] != null) {
>                 la[i].nodeTypeRegistered(ntName);
>             }
>         }
>     }
>
> It seems that the methods "notifyReRegistered" and "notifyUnregistered"
> will suffer from the same problem.
>
> Is this a known issue, and can it be solved?

no, it's not a known issue and yes, i am pretty confident that it
can be solved ;-)

please create a jira issue including instructions how to reproduce,
ideally with a simple test case. i'll take it from there.

thanks for the detailed jira issue (JCR-713) and suggesting a fix!
i fixed it in trunk (svn r497809).

cheers
stefan


cheers
stefan

>
> Thanks
>
> Martijn Hendriks
> <GX> creative online development B.V.
>
> t: 024 - 3888 261
> f: 024 - 3888 621
> e: [EMAIL PROTECTED]
>
> Wijchenseweg 111
> 6538 SW Nijmegen
> http://www.gx.nl/
>

Reply via email to