You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Strapz <st...@tiscali.it> on 2006/12/21 10:36:29 UTC
NodeList getLength ArrayIndexOutOfBoundsException
Hi all,
I have a strange problem that happen sometimes when trying to access the
SVGDocument.
I have to find all elements from a tag "title", and I use this function:
SVGDocument svgDoc = getSVGDocument();
NodeList nl = svgDoc.getElementsByTagName("title");
int totEl = nl.getLength();
I call this only after
SVGDocumentLoaderListener.documentLoadingCompleted have been called and
UpdateManager has started, but sometimes (I don't know exactly when...)
it generates an Exception like this:
java.lang.ArrayIndexOutOfBoundsException: -1
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.append(Unknown
Source)
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.initialize(Unknown
Source)
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.initialize(Unknown
Source)
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.initialize(Unknown
Source)
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.initialize(Unknown
Source)
at
org.apache.batik.dom.AbstractParentNode$ElementsByTagName.item(Unknown
Source)
at
it.integrasoftware.guienv.svg.SvgGuiEnvObj.initObj(SvgGuiEnvObj.java:229)
It's very strange...in 10 executions it can appen 1 time or never...
I'm using batik 1.6
Should I insert that code in the RunnableQueue?
Help me please, Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: NodeList getLength ArrayIndexOutOfBoundsException
Posted by th...@kodak.com.
Hi Strapz,
Strapz <st...@tiscali.it> wrote on 12/21/2006 04:36:29 AM:
> I have a strange problem that happen sometimes when trying to access the
> SVGDocument.
> I have to find all elements from a tag "title", and I use this function:
>
> SVGDocument svgDoc = getSVGDocument();
> NodeList nl = svgDoc.getElementsByTagName("title");
> int totEl = nl.getLength();
> Should I insert that code in the RunnableQueue?
Yes, this is most likely the problem. The document
is probably mutating under the 'getElementsByTagName' call so it's
state becomes corrupt during the execution.