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 Dmitrij Sakara <dm...@epfl.ch> on 2005/02/16 13:41:48 UTC

NullPointerException when using insertBefore() method

Hi
 
Thanks for great help with the Batik!
 
I have a problem with insertBefore method. The execution of a line
 
 element.insertBefore(element.getFirstChild(), someElement);
 
leads to exception 
 
java.lang.NullPointerException
 at org.apache.batik.dom.AbstractParentNode$ChildNodes.insert(Unknown
Source)
 at org.apache.batik.dom.AbstractParentNode.insertBefore(Unknown Source)
 
What can be a problem?
 
Thanks!!
 
 
___________________________________________
 
Dmitrij SAKARA

STI IPR LICP
Swiss Federal Institute of Technology (EPFL)
Me - Ecublens
CH-1015 Lausanne
Switzerland
 
Tel. : +41 (0)21 / 693 5913
Fax. : +41 (0)21 / 693 3509

e-mail : dmitrij.sakara@epfl.ch

My office at EPFL: http://map.epfl.ch/?room=MEA1382
___________________________________________
 

Re: NullPointerException when using insertBefore() method

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Dmitrij,

Dmitrij Sakara wrote:

> I have a problem with insertBefore method. The execution of a line

    What version of Batik? - 1.5.1 I presume.

>  element.insertBefore(element.getFirstChild(), someElement);
>  
> leads to exception: java.lang.NullPointerException

    Can you build a debug version of Batik (preferably CVS) so I
can see what line the problem is occurring at.  I've eyeballed the
code and assuming the childNode linked list doesn't have 'errors'
I don't see how you could get this with the current code (which
may mean that one of the other methods is the true problem but
knowing what line would help identify likely candidates).

>  at org.apache.batik.dom.AbstractParentNode$ChildNodes.insert(Unknown 
> Source)
>  at org.apache.batik.dom.AbstractParentNode.insertBefore(Unknown Source)
>  
> What can be a problem?


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org