xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendi Sisson <wsis...@east.fedex.com>
Subject parser maintains state?
Date Tue, 11 Dec 2001 18:00:26 GMT
I sent this email 12/6 but never saw it posted to the list, so I am
re-sending. 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

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message