I'm trying to use Xerces in an unsigned applet. I know it should be possible, but I get an AccessControlException:
Here's the exception:
I've also tried using the parser directly (SAXParser parser = new SAXParser()). It made no difference.
Anyone know what causes this, and how to fix it? It seems to me that it has something to do with it trying to read a System property.
Code:
try {
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
treemodel = new XMLTreeModel( new CategoryNode(-1,"root") );
parser.setContentHandler(treemodel);
parser.parse( // <- this line will throw exception
new InputSource(
new StringReader(
theXML
)
)
);
this.setModel(treemodel);
} catch (SAXException e) {
e.printStackTrace(); // Just print the stack trace
} catch (IOException e) {
e.printStackTrace(); // Just print the stack trace
}
Here's the exception:
Code:
java.security.AccessControlException: access denied (java.util.PropertyPermission entityExpansionLimit read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1276)
at java.lang.System.getProperty(System.java:573)
at java.lang.Integer.getInteger(Integer.java:814)
at java.lang.Integer.getInteger(Integer.java:731)
at org.apache.xerces.impl.XMLEntityManager.reset(XMLEntityManager.java:1077)
at org.apache.xerces.parsers.BasicParserConfiguration.reset(BasicParserConfiguration.java:544)
at org.apache.xerces.parsers.DTDConfiguration.reset(DTDConfiguration.java:630)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:502)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1142)
at no.xait.payg.toc.CategoryTree.<init>(CategoryTree.java:55)
at no.xait.payg.toc.TocAdmin.init(TocAdmin.java:52)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
I've also tried using the parser directly (SAXParser parser = new SAXParser()). It made no difference.
Anyone know what causes this, and how to fix it? It seems to me that it has something to do with it trying to read a System property.