我正在尝试在html中运行applet,但继续获取此NullPointerException。
下面是堆栈跟踪,
try {
FileInputStream fis = AccessController.doPrivileged(
new PrivilegedExceptionAction<FileInputStream>() {
public FileInputStream run() throws FileNotFoundException {
return new FileInputStream("someFile");
}
});
} catch (PrivilegedActionException e) {
// e.getException() should be an instance of FileNotFoundException,
// as only "checked" exceptions will be "wrapped" in a
// PrivilegedActionException.
throw (FileNotFoundException) e.getException();
}
我尝试过的事情:
包括accesscontrol.dopriviledge,
Bitwise compound assignment
小程序在applet查看器上运行完美。但是嵌入在html中,会产生NullPointerException。
请帮助。