Project

Profile

Help

Bug #2414

closed

org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing

Added by O'Neil Delpratt almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
Start date:
2015-07-09
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

Bug reported by Jörg Godau (initially in bug issue #2411):

We need to deactivate the secure Processing, as we are dealing with files with over 10000 (tenthousand) elements. We do that with:

final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);

This causes:

org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
at javax.xml.validation.SchemaFactory.setFeature(SchemaFactory.java:390)

Mike's response:

We should probably treat this as a bug, since the Javadoc does say that all implementations are expected to recognize this feature (and by implication, recognize a request to switch it off). But your application should work fine, I think, if you just avoid this call, or ignore the exception if it fails. There's a possibility that the underlying parser might impose size limits on the XML, but we've validated gigabyte-sized files without hitting any limits, so I would be surprised.

Please register to edit this issue

Also available in: Atom PDF