Re: String Index out bound exception : 34
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 08:55:06 -0400
Sanjeev wrote:
dear gurus
i m reading XML file in the form of string.
below is the code.
private void parseDocument(String receivedMessage) {
//get a factory
SAXParserFactory spf = SAXParserFactory.newInstance();
try {
//get a new instance of parser
SAXParser sp = spf.newSAXParser();
//parse the file and also register this class for call backs
sp.parse(new InputSource(new
ByteArrayInputStream(receivedMessage.getBytes())), this);
}catch(SAXException se) {
}catch(ParserConfigurationException pce) {
}catch (IOException ie) {
}
}
In this code i m getting error on line started with "sp.parse(..."
could any one help why i m getting this error..
Please do not use txtspeak.
Where do you get the XML input? Did you create it beforehand?
You're most likely getting an error (*what* error? Please copy-and-paste it into your post in future) because the XML document is either not valid or not well-formed.
You ignore every exception, so of course you lack the information necessary to debug the code. Put logging statements, or at the very, very least System.err.println() calls (never System.out for this purpose) into your catch blocks that tell you about the exception.
--
Lew
.
- Follow-Ups:
- Re: String Index out bound exception : 34
- From: Andrew Thompson
- Re: String Index out bound exception : 34
- References:
- String Index out bound exception : 34
- From: Sanjeev
- String Index out bound exception : 34
- Prev by Date: Re: J2EE Weblogic Developer required for IBM partner at Kuwait
- Next by Date: Re: J2EE Weblogic Developer required for IBM partner at Kuwait
- Previous by thread: String Index out bound exception : 34
- Next by thread: Re: String Index out bound exception : 34
- Index(es):
Relevant Pages
|