Questions tagged [accesscontrolexception]

An exception that occurs when trying to access an object for which you don't have the correct security authorization. For example, trying to access a file that doesn't allow read access by your user.

An exception that occurs when trying to access an object for which you don't have the correct security authorization.

This could occur as a result of many different actions, such as...

  1. Trying to perform an operation on a file, but you don;t have the appropriate security authorizations. For example, trying to write to a file that only allows read access.
  2. Trying to open a connection to a remote server, but specifying the incorrect login details. For example, trying to open a Socket, or communication to a Telnet or FTP server.

Your code should be able to prevent or handle this type of exception...

  1. Detect - Before performing any file operations, check the authorization permissions on the file, to see whether you are able to perform the desired operation. If not, you can perform an alternate operation, such as alerting the user of the error, or trying to access files in a different location of the file system instead.
  2. Handle - Wrap your file and communication interactions in exception-handling code, such as a try-catch block. This will allow you to catch unexpected exceptions such as this, and perform an alternate operation, such as alerting the user of the error.
131 questions
0
votes
1 answer

Applet is not able open socket connection in JRE 8 was working in JRE 7 and below

It was working fine with JDK 1.7 or earlier versions, but once we test with JDK 8 we are getting the following exception Exception in thread "cth" java.security.AccessControlException: access denied ("java.net.SocketPermission"…
Rajendar Reddy
  • 406
  • 3
  • 3
0
votes
0 answers

"access denied" when using ConcurrentSkipListSet in Java 8

I am doing the following inside a sandboxed Applet with Java 8u20: Set set = new ConcurrentSkipListSet(); set.add((int) 1); And i get the following exception: network: Cacheeintrag nicht gefunden [URL:…
0
votes
1 answer

java.security.AccessControlException: access denied Error while Reading the data from Excel file using Jxl jar

I have one doubt. I am trying to host one jsp website.in my website, i am trying to read the data from excel and store it in db. I am using jxl jar for connection.It is working fine in local.But it is not working in web.it is showing the…
Ranjith
  • 1
  • 3
0
votes
0 answers

appletviewer closing button stuff

This code is for closing the appletviewer window when the "close" button is pressed. It works fine; although, after closing the appletviewer window an error is given. import java.awt.*; import java.awt.event.*; import javax.swing.*; import…
radha
  • 1
  • 3
0
votes
1 answer

How to close frame within applet?

Guys am trying to close frame within applet... my program is working but the problem is that the frame which will get created within applet is not closing... what should i do... it gives me Exception while closing frame…
user3485153
  • 27
  • 2
  • 5
0
votes
0 answers

JNLP read file permission

My problem is that program cannot read file (I also don't see pop-up permission window when it's loading!) It's a JNLP file, in it I got (but still I don't see any pop-ups): < /security> when I execute that file it…
0
votes
1 answer

Loading image in JavaFX causes AccessControlException when deployed as jnlp

I have a very simple JavaFX application. It needs to draw an image I keep as a png in the "resources" directory. I initialize it like this: private final static Image customerImage; static { Path imageLink = Paths.get("resources",…
CarrKnight
  • 2,768
  • 2
  • 23
  • 25
0
votes
2 answers

Setting permissions for OSGi bundles

I've run into a problem trying to limit actions that the OSGi bundle can perform. According to the documents I've read, permissions for OSGi bundles should be set in OSGI-INF/permissions.perm file within bundle's JAR. However, no matter what I write…
Alex
  • 185
  • 1
  • 2
  • 6
0
votes
1 answer

Move File from /tmp to hosting account folder

I have write access to /tmp folder of my shared hosting account at godaddy. I want to move uploaded pictures from /tmp folder to my hosting account folder /home/content/x/y/z/xyz/html/pic/ I am trying to move file through jsp with no success. Folder…
Chava
  • 159
  • 1
  • 5
  • 21
0
votes
1 answer

how a client connect to server in Java RMI?

I am developing a simple phone book application in in RMI. I am able to start RMI registry and stub class is also generated for the Implementation c1ass. Now i have started the server by using command Java PhoneBookServer in my cmd prompt. The next…
Vishnu Kumar
  • 59
  • 1
  • 2
  • 7
0
votes
1 answer

Load a java applet with Jess rules in html

I have a java applet and i add it in a html file. My java applet include the jess library and i batch a file which has my rules in jess. When i run my project from Netbeans IDE everything it's perfect and work properly. But when i copy my folder…
NickName
  • 313
  • 2
  • 9
  • 25
0
votes
0 answers

Java AccesControlException

When I run my Java program, I get the following error: java.lang.ExceptionInInitializerError Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.security.policy" "read") To fix this, I was told to…
Black Magic
  • 2,706
  • 5
  • 35
  • 58
0
votes
1 answer

javax.sound.sampled.AudioPermission" "record" in java applets

I have created an applet with following structure - EXAMPLE -WEB-INF -web.xml -index.jsp -AudioApplet.java When i compile AudioApplet file i got 5 .class files.Then i ran following command to create the…
PSR
  • 39,804
  • 41
  • 111
  • 151
0
votes
1 answer

Chrome extension losing requested permissions after browser restart

I developed a chrome extension which communicates with IP phones. The communication is done in a event page which is sending POST requests via the XMLHttpRequest object. Because the hostname or IP address of the phone is configured in the options…
0
votes
1 answer

Applet AccessControlException in "business" method only

I have an applet, that does file signing using a certificate from smartcard, that means several extra permissions needed to get it working: loading .dll as file on local machine, creating temp files etc. All involved jars are signed and started as…
1 2 3
8 9