Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352046 - Need try/catch around features set in XmlParser
Summary: Need try/catch around features set in XmlParser
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 22:31 EDT by Jan Bartel CLA
Modified: 2011-07-14 02:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Bartel CLA 2011-07-13 22:31:49 EDT
The parser setFeature() calls need to be surrounded by try/catch blocks in case a feature is not supported, such as:

 _parser.getXMLReader().setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", validating);

On android 1.6 this throws:

E/Jetty   (  254): org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/nonvalidating/load-external-dtd
E/Jetty   (  254): 	at org.apache.harmony.xml.ExpatReader.setFeature(ExpatReader.java:130)
E/Jetty   (  254): 	at org.eclipse.jetty.xml.XmlParser.setValidating(XmlParser.java:110)
E/Jetty   (  254): 	at org.eclipse.jetty.xml.XmlParser.<init>(XmlParser.java:73)
E/Jetty   (  254): 	at org.eclipse.jetty.webapp.WebDescriptor.newParser(WebDescriptor.java:62)
E/Jetty   (  254): 	at org.eclipse.jetty.webapp.WebDescriptor.ensureParser(WebDescriptor.java:53)
Comment 1 Jan Bartel CLA 2011-07-14 02:05:31 EDT
Fixed for jetty-7.5.0