Handling the Exception: java.security.AccessControlException

Posted by Heeren On May - 23 - 2010

If you have been a programmer in JAVA, you must have noticed the occurrence of the exception: “java.security.AccessControlException”. Most of us are not much aware of the fact that it is further associated with the denial of the access to the remote machine. Such an exception shows that you are suffering from the policy concerns of Java Development Kit. There are various policies that are pre defined in the JDK which restricts the usage a bit.

Generally it is advised to put the jdk folder outside of the program files or to switch off your firewall, but sometimes it requires more than that. Here’s a screenshot to begin with:

Access control exception Handling the Exception: java.security.AccessControlException

java.security.AccessControlException [SOLVED]

In these easy steps you can solve this problem and it is advised to suppress all the permissions that are by default present whenever we are concerned with the project testing.

Step 1: Create a policy file of yours as shown with  .policy extension. Below is an example of the same. Save it with the name policyname.policy

In my case, i kept the policy name hs. Add to the file, the following lines:

[php]
grant
{
permission java.security.AllPermission;
}
[/php]

policy file Handling the Exception: java.security.AccessControlException

Step 2: Save this policy file in the C://Users/Username/

You can save it elsewhere too but it is advised to put it in the above mentioned folder. In my case, i saved it as:

C://Users/Heeren/

policy file1 Handling the Exception: java.security.AccessControlException

Step 3: Now head over to:

C:/~/jdk1.6<version>/jre/lib/security

Open up the file named java.security in notepad.

security file Handling the Exception: java.security.AccessControlException

Step 4: Your security file should look like the image below:

security file save Handling the Exception: java.security.AccessControlException

Search for the lines (it is better to search on the text wrapping option of the notepad):

[php]
policy.url.1=file:${java.home}/lib/security/java.policy

policy.url.2=file:${user.home}/.java.policy
[/php]

Embed the following line after the policy.url.2 line:

policy.url.3=file: path of the file .policy file that you have created above

In my case it looked like the following (remember the address of policy file saved in Step2):

[php]policy.url.3=file:c:/Users/Heeren/hs.policy[/php]

Now you are good to go through this kind of Access Denial permission. Your feedback and queries are always welcome.

This post is an answer to one of the question posted by our reader. If you also have any programming related questions or technical queries, let us know through our Contact Form.

Suggested reading:
Facebook Photos now Bigger and Better!
Facebook has emerged as one of the biggest photo sharing website; apart from bring the leader in Social Networking websites. With millions of photos viewed every second by its users, ...
READ MORE
Windows 7 Service Pack 1 RC Now Available For Download
Microsoft has released Windows 7 Service Pack 1 Release Candidate along with Windows Server 2008 R2 Service Pack 1. The Release Candidate includes the previous updates delivered over Windows Update. ...
READ MORE
Chromifox Transforms Mozilla Firefox to Google Chrome
Google Chrome has an awesome User interface that makes browsing experience amazing as compared to firefox, which has undergone a lot of development, without much attention paid to its look. ...
READ MORE
Get Ubuntu Installed on Nexus One! [Video]
Nexus one was amongst the first smartphones to get the newly released Android 2.2 "Froyo" installed on it. And, here's yet another first on the Android based handset! A group ...
READ MORE
iPhone 4 FaceTime Video Calling Comes to 3G with My3G App
Few hours ago, Comex released JailbreakMe 2.0 tool for iPhone 4 users to jailbreak their iDevice and soon use a fully functional iPhone 4 on unofficial carriers as well. And ...
READ MORE
Google may Announce Android 2.4 ‘Ice Cream’ at Google I/O
Google may announce the next version of Android Operating System, Android 2.4, dubbed as 'Ice Cream' in summer this year. The expected time-frame, as learnt by pocket-lint, could be around ...
READ MORE
15+ Amazing Wallpapers For Linux Lovers & Windows Haters! [Wallpaper Pack]
Recently, one of the readers of Linux section mailed us with some high definition Linux wallpapers. These were not only those ordinary wallpapers all of us have, but these also ...
READ MORE
Facebook’s New Liked News in Search; Inspired by Google Social Search?
It was a nice experience to join Marshall Kirkpatrick from ReadWriteWeb a few minutes ago on tinychat, where he was reporting about Facebook news search story. The feature was also ...
READ MORE
Facebook Photos now Bigger and Better!
Windows 7 Service Pack 1 RC Now Available
Chromifox Transforms Mozilla Firefox to Google Chrome
Get Ubuntu Installed on Nexus One! [Video]
iPhone 4 FaceTime Video Calling Comes to 3G
Google may Announce Android 2.4 ‘Ice Cream’ at
15+ Amazing Wallpapers For Linux Lovers & Windows
Facebook’s New Liked News in Search; Inspired by

Article by

I am a Linux fan and have keen interest in learning new technologies. Follow me on Twitter.

Heeren has written 8 articles for us at TechTickle.

2 Responses to “Handling the Exception: java.security.AccessControlException”

  1. Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!

  2. heerendevil says:

    Thanks buddy. Just chill. Every start is small but with the cooperation of you people we can increase our counts. I hope that this post will be helpful to you because it took me 7 days to figure out how to handle this situation for my networking related project. Thanks a lot again .

Leave a Reply

About Me

Welcome to TechTickle! A blog that features Latest technology news, Linux tutorials, Updates related to Social Media, Website & Software reviews and Open Source. We are a group of ordinary individuals, with an extra ordinary quality of sharing our passion and, reaching out to the people in nook and corner. Read more About TechTickle!

Twitter

    Subscribe to E-mail Updates: