NPE in parser->getDOMImplementation() with CNI

Andrew Haley aph@redhat.com
Sun Jun 21 15:46:00 GMT 2009


Sam Ruby wrote:
> I'm trying to develop a JAXP implementation using CNI, but I get a
> NullPointerException when I try to get a DOMImplementation.  I've
> attached a small script (tested on Ubuntu 9.04) which demonstrates the
> problem.
> 
> Any help would be appreciated.

Congratulations on this excellent test case.  Next time I want to tell
people how to do it right, I'll point them at your posting.

However, I get

 $ sh ~/testdomimpl.sh
gnu.xml.dom.DomDocumentBuilderFactory@160ecdad
gnu.xml.dom.DomDocumentBuilder@15ffbc45
gnu.xml.dom.DomImpl@15ef0ee5

gnu.xml.dom.DomDocumentBuilderFactory@2df0bea7
gnu.xml.dom.DomDocumentBuilder@2de03d5f
gnu.xml.dom.DomImpl@2dd0bfdf
 $ gcj --version
gcj (GCC) 4.4.0 20090307 (Red Hat 4.4.0-0.23)

Please compile everything -fpic.  IF you don't you can end up with copy
relocs for come classes.  You can compare nm --demangle ./testdomimpl2
with and without -fpic to see the effect of this.

I'm not sure what might be causing the problem you're seeing.  I guess it
must be because something isn't initialized, but I can't reproduce the
problem here.

Andrew.



More information about the Java mailing list