Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission createSecurityManager) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.<init>(Unknown Source) at net.jini.security.Security$ClassContextAccess.<init>(Security.java:965) at net.jini.security.Security$ClassContextAccess.<init>(Security.java:965) at net.jini.security.Security$1.run(Security.java:167) at java.security.AccessController.doPrivileged(Native Method) at net.jini.security.Security.<clinit>(Security.java:165) ... 10 more
Does anyone have any suggestion on how to fix these two problems?
Does anyone have any suggestion on how to fix these two problems?
For the fist one, add code to check if the file exists prior to trying to open it (see the isFile() method in the File class). If it does not exist, you need to create it first before trying to open it. (See the createNewFile() method in the File class.) You may also need to check the read and write permissions on the file. (See the File class for the canRead() and canWrite() methods.)
As for the second error, we'd need a bit more information on what it is you are trying to do that is generating the error. Also, is this a Java Applet or a Java Web Start application? Or a desktop application?