FYI - I sent this to netscape.dev.security:
I am trying to use the netcdf package within an applet,
and security issues arising in this package are
preventing it from using the java.lang.Class package,
even though I seem to have requested the
UniversalMemberAccess privilege. In more detail:
The thrown exception is:
netscape.security.AppletSecurityException: security.member access
The relevant part of the stack trace is
at netscape.security.AppletSecurity.checkMemberAccess(Compiled Code)
at java.lang.Class.checkMemberAccess(Compiled Code)
at java.lang.Class.getDeclaredConstructor(Compiled Code)
at ucar.netcdf.AbstractNetcdf.VariableCtor(Compiled Code)
at ucar.netcdf.AbstractNetcdf.<init>(Compiled Code)
* at ucar.netcdf.NetcdfFile.<init>(Compiled Code)
(Though I have requested UniversalMemberAccess, it seems
that it should not be needed, as
java.lang.Class.getDeclaredConstructor is
a public method?)
My calling code is:
try { // This must be in the same block?
netscape.security.PrivilegeManager.enablePrivilege(
"UniversalFileAccess");
netscape.security.PrivilegeManager.enablePrivilege(
"UniversalMemberAccess");
appendLine("Netscape privileges obtained.");
}
catch (NoClassDefFoundError ex){appendLine("NoClassDefFoundError");}
catch (Exception ex){appendLine("Exception");}
File netCdfFile = new File(sliceDir, fileName);
nc = new NetcdfFile(netCdfFile,
true, // clobber an existing file
true, // prefill variable values
schema // metadata template
);
Am I enabling the wrong privilege?