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:
Google Wave goes Mature: Now Available for Everyone
Google announced the general availability of Google Wave - the real-time communication and collaboration tool as a Google Labs project during Google I/O conference 2010. The over ambitious service was ...
READ MORE
Enhance your Music Collection in Ubuntu with Cover Thumbnailer
While randomly surfing for PPA's, I came across this amazing software script Cover Thumbnailer that allows you to have an easy to navigate music collection in Ubuntu Linux. It enhances ...
READ MORE
Facebook, Orkut & Myspace Desktop Client – Scrapboy
Its been a long time since i joined Orkut and Facebook, and i have always felt the need of a Desktop client that makes brings my social media profiles all ...
READ MORE
Customize Lucido AWN for 3D Style with Icon Sets
Few days ago, I introduced to you the game changing Features of Lucido Avant Window Navigator. Showcasing almost all the features of the best available Dock for linux, I forgot ...
READ MORE
Featuring iPhone 4: Thinnest Smartphone Ever
The curtain has finally been raised at Worldwide Developers Conference, and the 4th Generation of Apple iPhone is here. Steve Jobs unveiled the iPhone 4 in a keynote at WWDC ...
READ MORE
TechTickle Back Up and Running! Proudly Hosted on Hostgator
Hello readers! We're back, up and running very well after a long break. Apologies for not communicating the same earlier, but it was important in one way or the other, ...
READ MORE
Facebook Font Size Changed? Get Back the Original Font Size
Woke up this morning to see the reduced Facebook font-size. At once I checked the resolution settings on my system, but it was Facebook only who switched to smaller font ...
READ MORE
Change Taskbar Thumbnail Preview Size in Windows 7
Thumbnail Preview in Windows 7 allows you to view the running programs by simply hovering your mouse over their icon at the Taskbar. But, the default thumbnail size is too ...
READ MORE
Google Wave goes Mature: Now Available for Everyone
Enhance your Music Collection in Ubuntu with Cover
Facebook, Orkut & Myspace Desktop Client – Scrapboy
Customize Lucido AWN for 3D Style with Icon
Featuring iPhone 4: Thinnest Smartphone Ever
TechTickle Back Up and Running! Proudly Hosted on
Facebook Font Size Changed? Get Back the Original
Change Taskbar Thumbnail Preview Size in Windows 7

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: