Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352046

Summary: Need try/catch around features set in XmlParser
Product: [RT] Jetty Reporter: Jan Bartel <janb>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: 7.4.4   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:

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