You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Brent L Johnson <br...@bjohnson.net> on 2000/12/05 19:07:09 UTC

NullPointerException Confirmed

OK - I finally confirmed a NullPointerException in the parser (not sure
exactly where).  I've got two very similar instance documents both
validating against the same schema.  But, one of the documents parses
just fine - the other throws a NP exception.  I've done a compare of the
two documents and found that a tag was removed from the schema that
still existed in the document.

Turns out - anytime there is a validation failure I get a
NullPointerException thrown to the Tomcat console (this feature used to
work just fine and no changes have been made to that part of the code).

Here is the code I'm using when setting up the parser...

parser = new DOMParser();
ErrorHandler ehandler = new ValidationHandler();
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion",
false);
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
parser.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser.setErrorHandler(ehandler);
InputSource source = new InputSource(stream);
parser.parse(source);

It seems as though when the parse() method is called it throws the
exception.  Has anything been changed in Xerces related to error
handling of validation errors?

Thanks,

- Brent


Re: NullPointerException Confirmed

Posted by Eric Ye <er...@locus.apache.org>.

----- Original Message -----
From: "Brent L Johnson" <br...@bjohnson.net>
To: "Xerces List" <xe...@xml.apache.org>
Sent: Tuesday, December 05, 2000 10:07 AM
Subject: NullPointerException Confirmed


> OK - I finally confirmed a NullPointerException in the parser (not sure
> exactly where).  I've got two very similar instance documents both
> validating against the same schema.  But, one of the documents parses
> just fine - the other throws a NP exception.  I've done a compare of the
> two documents and found that a tag was removed from the schema that
> still existed in the document.
>
> Turns out - anytime there is a validation failure I get a
> NullPointerException thrown to the Tomcat console (this feature used to
> work just fine and no changes have been made to that part of the code).
>

That doesn't seem possible, have your tried to run you program standalone
instead of in Tomcat?

>
> It seems as though when the parse() method is called it throws the
> exception.  Has anything been changed in Xerces related to error
> handling of validation errors?
>

No, not that I know of.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org