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 Dave Flanagan <da...@trainingetc.com> on 2002/06/26 18:49:38 UTC

DocumentBuilderFactory's setAttribute() no longer working properly in xerces 2.0.2 ??

Using either the xerces-2_0_1 download from Apache or the one included in 
Sun's java_xml_pack-summer02 download
I am able to successfully do the following:

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();
dbf.setNamespaceAware(true);
dbf.setValidating(true);
	dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
	dbf.setAttribute(JAXP_SCHEMA_SOURCE, new File("test.xsd"));

where the constants in the setAttribute methods above are defined as follows:
     static final String JAXP_SCHEMA_LANGUAGE = 
"http://java.sun.com/xml/jaxp/properties/schemaLanguage";
     static final String W3C_XML_SCHEMA 
=       "http://www.w3.org/2001/XMLSchema";
     static final String JAXP_SCHEMA_SOURCE 
=   "http://java.sun.com/xml/jaxp/properties/schemaSource";

when the above is run using xerces-2_0_2

the    dbf.setAttribute(JAXP_SCHEMA_SOURCE, new File("test.xsd"));
results in a stack overflow exception starting as follows

Exception in thread "main" java.lang.StackOverflowError
         at java.io.FileNotFoundException.<init>(FileNotFoundException.java:57)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:59)
         at java.io.FileInputStream.<init>(FileInputStream.java:90)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.xsdToXMLInputSource(XMLSchemaLoader.java:647)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:580)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
         at 
org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)

and is stuck in a recursive loop generating the exception

Am wondering if an error was accidently introduced into the xerces-2_0_2 
release
or whether it is just me missing something

but it works fine in 2_0_1 - and not in 2_0_2

any help would be appreciated
Thank you - Dave Flanagan



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