ERROR - java.security.SecurityException - Possible Causes of SecurityException

Exception Thrown By:Cause
ClassMethod
AccessControlContext public DomainCombiner
getDomainCombiner()
if a security manager is installed
and the caller does not have the ""getDomainCombiner" SecurityPermission
AccessibleObject public void
setAccessible(boolean flag)
if the
request is denied
Applet public final void
setStub(AppletStub stub)
if the caller
cannot set the stub.
AuthProvider public abstract void
setCallbackHandler
(CallbackHandler handler)
if the caller does
not pass a security check.
Beans public static void
setDesignTime
(boolean isDesignTime)
if a security
manager exists and its check
Beans public static void
setGuiAvailable
(boolean isGuiAvailable)
if a security
manager exists and its check
Configuration public static void
setConfiguration
(Configuration configuration)
if the current
thread does not have permission.
Configuration public void
refresh()
if the caller does
not have permission to refresh its Configuration
CookieHandler public static void
setDefault
(CookieHandler cHandler)
If a security manager has
been installed and it denies
NetPermission("setCookieHandler")
Dialog public void
setModalityType
(Dialog.ModalityType type)
if the calling thread does not have
permission to create modal dialogs
 with the given modality
DriverManager public static void
setLogStream(PrintStream out)
if a security
manager exists and its check
File public String
getAbsolutePath()
If a required system
property value cannot be accessed
File public File
getAbsoluteFile()
If a required system
property value cannot be accessed.
File public URI
toURI()
If a required system
property value cannot be accessed
File public boolean
canRead()
If a security
manager exists and its SecurityManager
File public boolean
canWrite()
If a security
manager exists and its SecurityManager
File public boolean
exists()
If a security
manager exists and its SecurityManager
File public boolean
isDirectory()
If a security
manager exists and its SecurityManager
File public boolean
isFile()
If a security
manager exists and its SecurityManager
File public boolean
isHidden()
If a security
manager exists and its SecurityManager
File public long
lastModified()
If a security
manager exists and its SecurityManager
File public long
length()
If a security manager exists and
its SecurityManager.checkRead(java.lang.String)
method denies read access to the filecreate
File public boolean
delete()
If a security
manager exists and its SecurityManager
File public void
deleteOnExit()
If a security
manager exists and its SecurityManager
File public String[]
list()
If a security
manager exists and its SecurityManager
File public String[]
list(FilenameFilter filter)
If a security
manager exists and its SecurityManager
File public File[]
listFiles()
If a security
manager exists and its SecurityManager
File public File[]
listFiles(FilenameFilter filter)
If a security
manager exists and its SecurityManager
File public File[]
listFiles(FileFilter filter)
If a security
manager exists and its SecurityManager
File public boolean
mkdir()
If a security
manager exists and its SecurityManager
File public boolean
mkdirs()
If a security
manager exists and its SecurityManager
File public boolean
renameTo(File dest)
If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method denies write access to either
the old or new pathnames
File public boolean
setReadOnly()
If a security
manager exists and its SecurityManager
File public boolean
setWritable(boolean writable)
If a security
manager exists and its SecurityManager
File public boolean
setReadable(boolean readable)
If a security
manager exists and its SecurityManager
File public boolean
setExecutable
(boolean executable)
If a security
manager exists and its SecurityManager
File public boolean
canExecute()
If a security
manager exists and its SecurityManager
File public long
getTotalSpace()
If a security manager
has been installed and it denies
File public long
getFreeSpace()
If a security manager
has been installed and it denies
File public long
getUsableSpace()
If a security manager
has been installed and it denies
FileHandler public void
close()
if a security manager exists and
if the caller does not have
LoggingPermission("control")
FileInputStream public FileInputStream
(FileDescriptor
fdObj)
if a security
manager exists and its check
FileOutputStream public FileOutputStream
(FileDescriptor
fdObj)
if a security
manager exists and its check
Files public static boolean
isSymbolicLink(Path path)
In the case
of the default provider
Files public static boolean
isReadable(Path path)
In the case
of the default provider
Files public static boolean
isWritable(Path path)
In the case
of the default provider
Files public static boolean
isExecutable(Path path)
In the case
of the default provider
ForkJoinPool public void
shutdown()
if a security manager exists and
 the caller is
not permitted to modify threads
 because it does not hold
ForkJoinPool public List
shutdownNow()
if a security manager exists and
 the caller is
not permitted to modify threads
 because it does not hold
Formatter public Formatter(File
file)
If a security
manager is present and check
Graphics2D public abstract void
setComposite(Composite comp)
if a custom Composite object is
being used to render
to the screen and a security
manager is set and its check
Handler public void
setFormatter
(Formatter newFormatter)
if a security manager exists
and if the caller does not have
Handler public void
setEncoding(String encoding)
if a security manager exists and
if the caller does not have LoggingPermission("control").
Handler public void
setFilter(Filter newFilter)
if a security manager exists and
if the caller does not have
LoggingPermission("control")
Handler public void
setErrorManager
(ErrorManager em)
if a security manager exists and
if the caller does not have
LoggingPermission("control")
Handler public ErrorManager
getErrorManager()
if a security manager exists and
if the caller does not have LoggingPermission("control").
Handler public void
setLevel(Level newLevel)
if a security manager exists and
if the caller does not have LoggingPermission("control")
HttpURLConnection public static void
setFollowRedirects
(boolean set)
if a security
manager exists and its check
IdentityScope public static IdentityScope
getSystemScope()
if a security
manager exists and its check
Integer public static Integer
getInteger(String nm)
for the
same reasons as
Introspector public static void
setBeanInfoSearchPath
(String[] path)
if a security
manager exists and its check
JTable public boolean
print()
if this thread is not
allowed to initiate a print job request
JTable public boolean
print(JTable.PrintMode
 printMode)
if this thread is not
allowed to initiate a print job request
KeyTab public boolean
exists()
if a security manager exists and the
read access to the keytab file is not permittedto
Locale public static void
setDefault
(Locale newLocale)
if a security
manager exists and itscheck
LogManager public void
removeProperty
ChangeListener
(PropertyChangeListener l)
if a security manager exists and
if the caller does not have LoggingPermission("control")
LogManager public void
readConfiguration()
if a security manager exists and
if the caller does not have LoggingPermission("control").IOE
LogManager public void
reset()
if a security manager exists
and if the caller does not have
LogManager public void
readConfiguration
(InputStream ins)
if a security manager exists and
if the caller does not have LoggingPermission("control").IOE
LogManager public void
checkAccess()
if a security manager exists and
if the caller does not have LoggingPermission("control")
Logger public void
setFilter(Filter newFilter)
if a
security manager exists
Logger public void
setLevel(Level newLevel)
if a
security manager exists
Logger public void
addHandler
(Handler handler)
if a
security manager exists
Logger public void
removeHandler
(Handler handler)
if a
security manager exists
Logger public void
setUseParentHandlers
(boolean useParentHandlers)
if a
security manager exists
Logger public void
setParent(Logger parent)
if a security manager exists
and ifthe caller does not have LoggingPermission("control")
Long public static Long
getLong(String nm)
for the
same reasons as
MBeanServerFactory public static MBeanServer
createMBeanServer()
if there is a SecurityManager and the
caller's permissions do not include or imply MBeanServerPermission("createMBeanServer").JMRuntimeE
MBeanServerFactory public static MBeanServer
createMBeanServer
(String domain)
if there is a SecurityManager and the
caller's permissions do not include or imply MBeanServerPermission("createMBeanServer").JMRuntimeE
MBeanServerFactory public static MBeanServer
newMBeanServer()
if there is a SecurityManager and the
caller's permissions do not include or imply MBeanServerPermission("newMBeanServer").JMRuntimeE
MBeanServerFactory public static
MBeanServer
newMBeanServer
(String domain)
if there is a SecurityManager and the
caller's permissions do not include or imply MBeanServerPermission("newMBeanServer").JMRuntimeE
MBeanServerFactory public static ArrayList
findMBeanServer

(String agentId)
if there is a SecurityManager and
the caller's permissions do not include or imply
MBeanServerFactory public static
ClassLoaderRepository
getClassLoaderRepository
(MBeanServer server)
if there is a SecurityManager and the
caller's permissions do not include or imply MBeanPermission("getClassLoaderRepository").NullPointerE
MemoryHandler public void
close()
if a security manager exists
and if the caller does not have
MemoryHandler public void
setPushLevel
(Level newLevel)
if a security manager exists and
if the caller does not have LoggingPermission("control")
MethodHandles
.Lookup
public MethodHandleInfo
revealDirect
(MethodHandle target)
if a security manager
is present and itrefuses access
Policy public static void
setPolicy(Policy p)
if a security
manager exists and itscheck
Policy public static void
setPolicy(Policy policy)
if the current thread does
nothave permission to set the Policy
Policy public abstract void
refresh()
if the caller does
not have permissionto refresh the Policy
Preferences public static Preferences
userRoot()
If a security manager
is present and it denies RuntimePermission("preferences")
Preferences public static Preferences
systemRoot()
If a security manager
is present and it denies RuntimePermission("preferences")
PropertyEditorManager public static void
setEditorSearchPath
(String[] path)
if a security
manager exists and its check
ProxySelector public static void
setDefault
(ProxySelector ps)
If a security manager has
been installed and it denies NetPermission("setProxySelector")
RMISocketFactory public static void
setFailureHandler
(RMIFailureHandler fh)
if a security
manager exists and itscheck
RemoteServer public static void
setLog(OutputStream out)
if there is a security
manager andthe invocation of its check
ResponseCache public static void
setDefault(ResponseCache
responseCache)
If a security manager has
been installed and it denies NetPermission("setResponseCache")
Runtime public void
halt(int status)
If a security manager
is present and its check
Runtime public static void
runFinalizersOnExit
(boolean value)
if a security
manager exists and its check
Runtime public Process
exec(String command)
If a security
manager exists and itscheck
Runtime public Process
exec(String[] cmdarray)
If a security
manager exists and itscheck
Runtime public void
load(String filename)
if a security manager exists and its check
if either the filename is not an absolute path name
Runtime public void
loadLibrary(String libname)
if a security manager exists and its check
if either the libname argument contains a file path
ScheduledThread
PoolExecutor
public void
shutdown()
if a security manager exists and shutting down this ExecutorService may manipulate threads
that the caller is not permitted to modify because it does not hold RuntimePermission("modifyThread")
ScheduledThread
PoolExecutor
public List
shutdownNow()
if a security manager exists and shutting down this ExecutorService may manipulate threads
that the caller is not permitted to modify because it does not hold RuntimePermission("modifyThread")
Security public static void
removeProvider(String
name)
if a security
manager exists and its SecurityManager
Security public static String
getProperty(String key)
if a security manager exists and its
SecurityManager.checkPermission(java.security.Permission) methoddeniesaccess to retrieve the specified security property value
SecurityManager public void
checkPermission
(Permission perm)
if access is not
permitted based onthe current security policy.
SecurityManager public void
checkCreateClassLoader()
if the calling thread does not
have permission to create a new class loader.
SecurityManager public void
checkAccess(Thread t)
if the calling thread does
not have permission to modify the thread.
SecurityManager public void
checkAccess(ThreadGroup g)
if the calling thread does not
have permission to modify the thread group.
SecurityManager public void
checkExit(int status)
if the calling thread does not havepermission
to halt the Java Virtual Machine withthe specified status.
SecurityManager public void
checkExec(String cmd)
if the calling thread does
not have permission to create a subprocess.
SecurityManager public void
checkLink(String lib)
if the calling thread does not
have permission to dynamically link the library.
SecurityManager public void
checkRead(FileDescriptor fd)
if the calling thread does not
have permission to access the specified file descriptor.
SecurityManager public void
checkRead(String file)
if the calling thread does not
have permission to access the specified file.
SecurityManager public void
checkWrite(FileDescriptor fd)
if the calling thread does not
have permission to access the specified file descriptor.
SecurityManager public void
checkWrite(String file)
if the calling thread does not
have permission to access the specified file.
SecurityManager public void
checkDelete(String file)
if the calling thread does
not have permission to delete the file.
SecurityManager public void
checkListen(int port)
if the calling thread does not
have permission to listen on the specified port.
SecurityManager public void
checkMulticast
(InetAddress maddr)
if the calling thread is
not allowed touse (join/leave/send/receive) IP multicast.
SecurityManager public void
checkPropertiesAccess()
if the calling thread does not have
permission to access or modify the system properties.
SecurityManager public void
checkPropertyAccess
(String key)
if the calling thread does not
have permission to access the specified system property.
SecurityManager public void
checkPrintJobAccess()
if the calling thread does not
have permission to initiate a print job request.
SecurityManager public void
checkSystem
ClipboardAccess()
if the calling thread does not
have permission to access the system clipboard.
SecurityManager public void
checkAwtEvent
QueueAccess()
if the calling thread does not
have permission to access the AWT event queue.
SecurityManager public void
checkPackageAccess
(String pkg)
if the calling thread does not
have permission to access the specified package.
SecurityManager public void
checkPackageDefinition
(String pkg)
if the calling thread does not have
permission to define classes in the specified package.
SecurityManager public void
checkSetFactory()
if the calling thread does not have permission
to specify a socket factory or a stream handler factory.
SecurityManager public void
checkSecurityAccess
(String target)
if the calling thread does
not have permission for the requested access.
Service public void
setExecutor
(Executor executor)
If the instance does not support
setting an executor for security reasons (e
ServiceDelegate public abstract void
setExecutor
(Executor executor)
If the instance does not support
setting an executor for security reasons (e
Signer public PrivateKey
getPrivateKey()
if a security
manager exists and its check
SocketHandler public void
close()
if a security manager exists and
if the caller does not have LoggingPermission("control")
StreamHandler public void
setEncoding(String encoding)
if a security manager exists and
if the caller does not have LoggingPermission("control").UnsupportedEncodingE
StreamHandler public void
close()
if a security manager exists and
if the caller does not have LoggingPermission("control")
SyncFactory public static void
setLogger(Logger logger)
if a security
manager exists and its check
System public static void
setOut(PrintStream out)
if a security
manager exists and itscheck
System public static void
setErr(PrintStream err)
if a security
manager exists and itscheck
System public static void
setSecurityManager
(SecurityManager s)
if the security manager has
already been set and its check
System public static Properties
getProperties()
if a security
manager exists and its check
System public static void
setProperties(Properties props)
if a security
manager exists and its check
System public static String
getProperty(String key)
if a security
manager exists and its check
System public static String
clearProperty(String key)
if a security
manager exists and its check
System public static void
exit(int status)
if a security
manager exists and its check
System public static void
runFinalizersOnExit
(boolean value)
if a security
manager exists and its check
System public static void
load(String filename)
if a security manager exists and its check
if either the filename is not an absolute path name
System public static void
loadLibrary(String libname)
if a security manager exists and its check
if either the libname argument contains a file path
ThreadGroup public final ThreadGroup
getParent()
if the current thread
cannot modify this thread group.
ThreadGroup public final void
setDaemon(boolean daemon)
if the current thread
cannot modify this thread group.
ThreadGroup public final void
setMaxPriority(int pri)
if the current thread
cannot modify this thread group.
ThreadGroup public final void
checkAccess()
if the current thread is
not allowed to access this thread group
ThreadPoolExecutor public void
shutdown()
if a security manager exists and shutting down this ExecutorService may manipulate threads
that the caller is not permitted to modify because it does not hold RuntimePermission("modifyThread")
ThreadPoolExecutor public List
shutdownNow()
if a security manager exists and shutting down this ExecutorService may manipulate threads
that the caller is not permitted to modify because it does not hold RuntimePermission("modifyThread")
TimeZone public static void
setDefault
(TimeZone zone)
if the
security manager's check
Window public void
setModalExclusionType
(Dialog.
ModalExclusionType exclusionType)
if the calling thread does not have permission to set
the modal exclusion property to the window with the given exclusion
Window public final void
setAlwaysOnTop
(boolean alwaysOnTop)
if the calling thread does not have permission
to set the value of always on top property