Name: sg39081 Date: 03/20/2000
java version "3.1.1 (Sun 1.1.6)"
(uname -a : IRIX64 toscana 6.5 07151440 IP30)
In JDK1.1 appletviewer, and non-PlugIn (jdk1.1) netscape, use of the Java API
for XML Parsers (JAXP) v.1.0 throws a SecurityException when accessing System
property. This is used to specify the implementation of the Abstract Factory classes.
The API doc claims:
(http://java.sun.com/xml/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#DocumentBu
ilderFactory())
"This static method creates a new factory instance based on a System property
setting or uses the platform default if no property has been defined."
It SEEMS like the SecurityException hasn't been caught, and should just be
caught, then the platform default loaded.
It works in a Java2 appletviewer.
<pre>
import java.applet.Applet;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
public class JAXPFailApplet extends Applet {
public JAXPFailApplet() {
System.out.println("cosntruct");
}
public void init() {
try {
DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
System.out.println("here");
} catch (ParserConfigurationException pce) {
// handle error
}
}
public void start() {
System.out.println("started");
}
}
jdk1.1 appletviewer:
sun.applet.AppletSecurityException: checkpropsaccess.key
at sun.applet.AppletSecurity.checkPropertyAccess(AppletSecurity.java:288)
at java.lang.System.getProperty(System.java:454)
at
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:68)
at JAXPFailApplet.init(JAXPFailApplet.java:14)
at sun.applet.AppletPanel.run(AppletPanel.java:287)
at java.lang.Thread.run(Thread.java:474)
</pre>
(Review ID: 102491)
======================================================================