Q
Qu0ll
I am trying to configure the built-in Java logging within an applet using
6u11 but I encounter the following:
java.security.AccessControlException: access denied
(java.util.logging.LoggingPermission control)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.logging.LogManager.checkAccess(Unknown Source)
at java.util.logging.LogManager.readConfiguration(Unknown Source)
at com.test.MyApplet.init(MyApplet.java:50)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied
(java.util.logging.LoggingPermission control)
The relevant lines in MyApplet are:
final LogManager lm = LogManager.getLogManager();
final String s = "handlers=java.util.logging.ConsoleHandler";
final InputStream is = new java.io.ByteArrayInputStream(s.getBytes());
try {
lm.readConfiguration(is);
} catch (final IOException ioe) {
System.err.println(ioe);
}
The exception is generated when the readConfiguration() is called. This
same code works fine in an application.
Does Java logging work within applets? How do I get around this exception?
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
6u11 but I encounter the following:
java.security.AccessControlException: access denied
(java.util.logging.LoggingPermission control)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.logging.LogManager.checkAccess(Unknown Source)
at java.util.logging.LogManager.readConfiguration(Unknown Source)
at com.test.MyApplet.init(MyApplet.java:50)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied
(java.util.logging.LoggingPermission control)
The relevant lines in MyApplet are:
final LogManager lm = LogManager.getLogManager();
final String s = "handlers=java.util.logging.ConsoleHandler";
final InputStream is = new java.io.ByteArrayInputStream(s.getBytes());
try {
lm.readConfiguration(is);
} catch (final IOException ioe) {
System.err.println(ioe);
}
The exception is generated when the readConfiguration() is called. This
same code works fine in an application.
Does Java logging work within applets? How do I get around this exception?
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]