You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ron Rothblum <RO...@il.ibm.com> on 2003/03/25 16:35:16 UTC
exception during parsing
I use the following code to parse an xml file:
public boolean parse(final InputStream configuation) {
DOMParser parser = new DOMParser();
ParserErrorHandler errHandler = new ParserErrorHandler();
parser.setFeature("http://xml.org/sax/features/validation",
true);
parser.setFeature(
"http://apache.org/xml/features/validation/schema", true);
parser.setFeature(
"http://apache.org/xml/features/dom/defer-node-expansion", false);
parser.setFeature("http://xml.org/sax/features/namespaces",
true);
parser.setFeature(
"http://apache.org/xml/features/validation/schema-full-checking", true);
parser.setFeature(
"http://apache.org/xml/features/validation/schema/element-default", true);
parser.setFeature(
"http://apache.org/xml/features/validation/schema/normalized-value", true);
parser.setErrorHandler(errHandler);
parser.parse(new InputSource(configuation));
and sometimes I get the following exception:
java.lang.ExceptionInInitializerError: java.lang.NullPointerException
at
org.apache.xerces.impl.xs.SubstitutionGroupHandler.<clinit>(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.<init>(Unknown
Source)
at
org.apache.xerces.parsers.IntegratedParserConfiguration.configurePipeline(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.reset(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
Exception in thread "main"
adding or commenting a line in a completely different place alters this
behaviour (sometimes I get an exception sometimes the parsing succeeds).
Even adding a line such as System.out.print("") can alter the behaviour. I
have no other threads running simultaneously.
Please help ASAP,
Thanks,
Ron Rothblum.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org