Hello, I stil have a question ?! What about changing the dom befor the UpdateManager is available, eg. in public void documentLoadingCompleted(SVGDocumentLoaderEvent e)... ? This must be okay, or ? Because no UpdateManager Runnable is working at this time ? I mean i will to the modification directly in the Thread that is calling the documentLoadingCompleted. Mit freundlichen Grüßen Michael Kerschbaum
DI (FH) Michael Kerschbaum PKE Electronics AG Zentrale Wien / Entwicklung Computerstraße 6 A - 1101 Wien TEL: +43 (0) 50 150 - 1210 [EMAIL PROTECTED] www.pke.at <http://www.pke.at/> Aktiengesellschaft mit dem Sitz in Wien Firmenbuchnummer 103264i HG Wien, DVR 0159701 Johann Helf - Vorsitzender des Vorstandes Bruno Faustka - Mitglied des Vorstandes Christian Prelz - Vorsitzender des Aufsichtsrates ________________________________ Von: Kerschbaum Michael [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 10. Oktober 2008 13:14 An: [email protected] Betreff: AW: Watching the UpdateManagerThread if dead of alive ?! Restart, Stopping etc.. Watchdog ? Hello, Anyway thanks a lot for helping... I would have had a big problem if i didn' get that hints. Mit freundlichen Grüßen Michael Kerschbaum DI (FH) Michael Kerschbaum PKE Electronics AG Zentrale Wien / Entwicklung Computerstraße 6 A - 1101 Wien TEL: +43 (0) 50 150 - 1210 [EMAIL PROTECTED] www.pke.at <http://www.pke.at/> Aktiengesellschaft mit dem Sitz in Wien Firmenbuchnummer 103264i HG Wien, DVR 0159701 Johann Helf - Vorsitzender des Vorstandes Bruno Faustka - Mitglied des Vorstandes Christian Prelz - Vorsitzender des Aufsichtsrates ________________________________ Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 10. Oktober 2008 13:07 An: [email protected] Cc: [email protected] Betreff: Re: Watching the UpdateManagerThread if dead of alive ?! Restart, Stopping etc.. Watchdog ? Hi Kerschbaum, "Kerschbaum Michael " <[EMAIL PROTECTED]> wrote on 10/10/2008 06:54:28 AM: >> Actually I just thought of a much better place to check it, >> add the above check to batik.gvt.UpdateTracker.changeStarted. > > It was a good idea to put the check there. Now i know where the > application calls Dom modifications not in the Runnable. But is it > possible to do something better then writting out ?! I'am isn't > possible to transfer the action into the Runnable ?! I mean the > batik could recognize this and can do something ?! Actually the damage is done by the time that method is called. This is just the trailing edge of the problem. It is entirely possible that your simultaneous DOM/SMIL/CSS manipulation would corrupt internal data structures. The problem often shows up here since the iterators over the dirty list are fairly long lived and have checks for concurrent modifications - so it does a good job of detecting the problem but it's not the only problem. I may see if I can add a simple check for concurrent calls to changeStarted and getDirtyAreas in changeStarted, it won't be quite as good as the thread check but it will give the warning on the more useful side of the problem. > The Problem is that the Runnable is a very central Thread, that must > not die. If this Thread is dead, displaying SVG's are dead, every > action is dead ?! Right, that is why I suggested adding the try/catch block around the runnableInvoked call in the RunnableQueue. The RunnableQueue should probably not die just because that method throws an exception. I will probably commit that change to the SVN repository. > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 09. Oktober 2008 19:04 > An: [email protected] > Cc: [email protected] > Betreff: Re: AW: Watching the UpdateManagerThread if dead of alive > ?! Restart, Stopping etc.. Watchdog ? > > Hi Michael, > > "Kerschbaum Michael " <[EMAIL PROTECTED]> wrote on 10/09/2008 10:25:17 AM: > > > Thank you for the tipps. > > > > 1.)How can i set the document back to the canvas ? > > > > canvas.setDocument(canvas.getDocument()); ?? => what is the > > canvas in this case ? is this the JSVGComponent itself ? > > Yes, it's the JSVGComponent (except most people subclass the > JSVGCanvas which is why it's called canvas). > > > 2.)adding a try cache block to the Runnable Queue ?! > > > > Where exactly shoud i do this ? at the point where the > > IllegalStateException is thrown ?! Or where i call invokeLater ?! > > Where the exception is thrown (around the 'runnableInvoked(rable)' > call in the run method). > > > At the meantime i searched for the modification Methods and call > > them in an own class an ask if the current Thread is a > > UpdateManager's RunnableQueue Thread ?? if not i print a Stack Trace. > > > > if (Thread.currentThread() == ag.getUpdateManager(). > > getUpdateRunnableQueue().getThread()) { > > parentNode.replaceChild(newElement,oldElement); > > } else { > > logger.fatal("[replaceChild] node -was not called in the > > UpdateManagers RunnableQueue."); > > printCallStack(); > > } > > This should work assuming you track down all of the mutation > points. > > Actually I just thought of a much better place to check it, > add the above check to batik.gvt.UpdateTracker.changeStarted. > I think that should catch all changes that could possibly > cause trouble (which might include things like animations > and CSS which the DOM checks might not catch), and it's just > once place that you need to change... > > > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Gesendet: Donnerstag, 09. Oktober 2008 12:16 > > An: [email protected] > > Cc: [email protected] > > Betreff: Re: Watching the UpdateManagerThread if dead of alive ?! > > Restart, Stopping etc.. Watchdog ? > > > > > Hi Michael, > > > > "Kerschbaum Michael " <[EMAIL PROTECTED]> wrote on 10/09/2008 04:31:15 AM: > > > > > The Problem is now that the application itself wont't work anymore. > > > Is there a possibility to restart or watch the RunnableQueue, and in > > > case of such an error?! > > > > The simplest way to reboot the RunnableQueue would be to > > set the document back to the canvas: > > > > canvas.setDocument(canvas.getDocument()); > > > > You can know the runnnablequeue is dead by > > calling 'getThread()' on the UpdateManager's RunnableQueue > > if it returns null then it has died. > > > > > I mean i have to find the modification of the dom tree outside of > > > the updateManager, but I would like to have a fail back, and a quick > > > solution to this problem ? > > > > A slightly better short term solution would be to > > protect the RunnableQueue from runnableInvoked throwing > > an exception (adding a try cache block to the RunnableQueue). > > > > BTW to find the problem you might try instrumenting the > > DOM so that various methods check the current thread to see > > if it matches the UpdateManager's RunnableQueue Thread > > (assuming an UpdateManager is associated with the DOM). > > > > I would add the code to batik.dom.AbstractElement.setAttribute > > and setAttributeNS, as well as batik.dom.AbstractParentNode.appendChild > > That should check the most likely problems.
