Hello,

I am receiving a ConcurrentModificationException occasionally in the
UpdateManager's RunnableQueue and was hoping someone else may have a
solution to my situation.

I have a Thread which has access to a SVGDocument instance, and modifies
it.  This Thread does not have access to the JSVGCanvas, and therefore
does not have access to the UpdateManager , which is why I am changing
the Document on a different thread.

I also have a GUI, which has access to the same SVGDocument.  It adds an
EventListener for attribute changes within the Document so it can
repaint.  To repaint, I simply place an empty Runnable on the
UpdateManager thread.

When I run my Application, eventually the UpdateManager's RunnableQueue
dies, with the following Exception and stack

java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
        at java.util.HashMap$KeyIterator.next(HashMap.java:818)
        at
org.apache.batik.gvt.UpdateTracker.getDirtyAreas(UpdateTracker.java:67)
        at
org.apache.batik.bridge.UpdateManager.repaint(UpdateManager.java:433)
        at
org.apache.batik.bridge.UpdateManager$UpdateManagerRunHander.runnableInv
oked(UpdateManager.java:571)
        at
org.apache.batik.util.RunnableQueue.runnableInvoked(RunnableQueue.java:4
57)
        at
org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:187)
        at java.lang.Thread.run(Thread.java:534)

I'm assuming my Thread modifying the Document is causing the
DirtyRegions List to change while repaint is still iterating it.  This
Exception then causes the JSVGCanvas to be useless since its
RunnableQueue has died.  I am looking to do any one of three things to
fix my problems

1. Gain access the UpdateManager's RunnableQueue instance without access
to the JSVGCanvas
2. Repaint the JSVGCanvas without doing an invokeLater on the
RunnableQueue
3. Be able to recover from this Exception.  I know when it occurs, but
am unable to get the JSVGCanvas to start up a new RunnableQueue

If anyone can offer some guidance on how to do any of those 3 (or any
other suggestions), that would be fantastic

I have received this Exception using Batik 1.5.1 and the latest from
CVS.  I am using java sdk 1.4.2_04 on Windows 2000

Thank you,
-Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to