javax SchemaFactory disable access to external entities not recognized
I am using javax SchemaFactory to parse an XML file. I get a SonarLint warning “Disable access to external entities in XML parsing.”. The warning goes away when adding two properties “ACCESS_EXTERNAL_DTD” and “ACCESS_EXTERNAL_SCHEMA”. However, when parsing something I get the runtime error “Feature ‘http://javax.xml.XMLConstants/property/accessExternalDTD’ is not recognized.”. Why is it not recognized and how to fix this? My code: