OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   parser maintains state?

[ Lists Home | Date Index | Thread Index ]

We are experiencing 2 problems with our application. One appears to be
something wrong with our XML or our parser, and the other is the
possibility that we are maintaining state when we do not want to. Any
advice, direction or similar experiences would be greatly appreciated. I
will glad to supply more detail as needed.

1. We have an unknown error in the XML. We are using Xerces J 1. The XML
appears to be valid - it can be parsed by a DOMParser and validated
against the DTD. However, we get a null pointer exception when we try to
get the length of the NodeList resulting from a getElementsByTagName
method call. This occurs with many different XML documents that are
validated by about 5 different DTDs. The code that actually throws the
exception is:

Document doc = parser.getDocument();
if (doc == null) {
    // this exception is never thrown
    throw new TradeXpressException("Doc null"); 

NodeList nlist = doc.getElementsByTagName("a");
if (nlist == null) {
    // this exception is never thrown
    throw new TradeXpressException("NodeList null"); 

try {
    int len = nlist.getLength();
} catch(Exception ex){
    // we parse the same XML document repeatedly and have no exceptions
    // then, after X number of times (sometimes as few as 8 or as many
as 100),
    //   we catch a null pointer exception here
    throw new TradeXpressException("Exception thrown: " + ex);

2. Even more frustrating than the problem above, our whole system is
hung after we encounter this error once. We instantiate a new parser
every time we parse a new XML document, so it seems to me we should not
be getting hung up unless Xerces is maintaining some kind of state. Has
anyone experienced any problems with a parser, Xerces J in particular,
maintaining a state? Our system is OK again after we cycle the VMs.

Thanks for any help,
Wendi Sisson

Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS