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 22:26:03 UTC
Xerces Debugging
Since apparently no one seems to have any ideas as to why Xerces is
failing with a NullPointerException on me, and it's failed at a bad time
for me (right here at a scheduled deadline when others are trying to
test their products by posting xml data and receiving a NPE instead of
some idea as to what is wrong with their xml file) I'll try and track it
down myself.
Could someone at least point me in the direction of some debugging tools
(other than jdb since this is running as a servlet I dont see how that
will help) - maybe a wrapper or something that monitors the servlet
during runtime - that would allow me to at least narrow down the section
of code that's causing the exception?
Thanks,
- Brent
Re: Xerces Debugging
Posted by Maitreyee Pasad <pa...@gst.com>.
Brent,
I used to get this problem when there was something wrong in my SAX code.
I realized that very often when the Parser found an error instead of
specifying where
the error was it would just return a NULLPointer Excetpion.
then I looked into the xerces code and found that debugging was turned off
by default in
org.apache.xerces.framework.XMLParser.
// debugging
/** Set to true and recompile to print exception stack trace. */
private static final boolean PRINT_EXCEPTION_STACK_TRACE = true;
This caused the real cause of the Exception to be hidden in the parse()
} catch (Exception ex) {
fParseInProgress = false;
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw new org.xml.sax.SAXException(ex);
}
I set this to true and recreated xerces.jar
After that the real exception that causes the problem gets printed in the
stack trace and debugging is easier.
also I looked at SAXParser.java file There is a debugging field
/** Set to true and recompile to debug callbacks. */
private static final boolean DEBUG_CALLBACKS = false;
If you set that to true you will see the call backs. That should help you
identify what exact call creates an error.
Let me know if this helped.
All the Best.
Maitreyee
Brent L Johnson wrote:
> Since apparently no one seems to have any ideas as to why Xerces is
> failing with a NullPointerException on me, and it's failed at a bad time
> for me (right here at a scheduled deadline when others are trying to
> test their products by posting xml data and receiving a NPE instead of
> some idea as to what is wrong with their xml file) I'll try and track it
> down myself.
>
> Could someone at least point me in the direction of some debugging tools
> (other than jdb since this is running as a servlet I dont see how that
> will help) - maybe a wrapper or something that monitors the servlet
> during runtime - that would allow me to at least narrow down the section
> of code that's causing the exception?
>
> Thanks,
>
> - Brent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: Xerces Debugging
Posted by Tom Bradford <br...@dbxmlgroup.com>.
Brent L Johnson wrote:
> Could someone at least point me in the direction of some debugging tools
> (other than jdb since this is running as a servlet I dont see how that
> will help) - maybe a wrapper or something that monitors the servlet
> during runtime - that would allow me to at least narrow down the section
> of code that's causing the exception?
System.err.println :) Always works for me
-- Tom