commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38894] New: - ParserFeatureSetterFactory uses a wrong method to detect the use of Xerces parser
Date Wed, 08 Mar 2006 17:30:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38894>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38894

           Summary: ParserFeatureSetterFactory uses a wrong method to detect
                    the use of Xerces parser
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Digester
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: pse@infologic.fr


The ParserFeatureSetterFactory relies on the presence of the
org.apache.xerces.impl.Version class in the classpath to determine that the
Xerces parser is being used. However it's not always the case and it's possible
that a different parser is actually being used. In this case the non-standard
features that are set on the parser factory in the XercesParser class will cause
an exception to be thrown. The following exception is thrown when using the
Crimson XML parser with Xercer parser in the classpath:

org.xml.sax.SAXNotRecognizedException: Feature:
http://apache.org/xml/features/validation/dynamic
	at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:219)
	at org.apache.crimson.jaxp.SAXParserImpl.setFeatures(SAXParserImpl.java:150)
	at org.apache.crimson.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:133)
	at
org.apache.crimson.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:113)
	at
org.apache.crimson.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:141)
	at
org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
	at
org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
	at
org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:71)
	at org.apache.commons.digester.Digester.getParser(Digester.java:692)
	at org.apache.commons.digester.Digester.getXMLReader(Digester.java:899)
	at org.apache.commons.digester.Digester.parse(Digester.java:1647)

This problem can be easily reproduced on JDK 1.4.2, which bundles the Crimson
parser, by forcing a non-Xerces using the following:

    	System.setProperty("javax.xml.parsers.SAXParserFactory",
		"org.apache.crimson.jaxp.SAXParserFactoryImpl");

The test application must have the Xerces parser in the classpath. This bug is
present both in versions 1.6 and 1.7.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message