File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Endless Loop from Security Check Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Endless Loop from Security Check" Watch "Endless Loop from Security Check" New topic
Author

Endless Loop from Security Check

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I have implemented my own Policy class and set it as the system-wide policy. In the "implies(ProtectionDomain, Permission)" method I do some stuff with the domain and permission objects passed in. the problem is, when I do that, it causes a security check which calls this implies method - i.e. I get a never-ending loop! Any idea how I can stop this endless loop?
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
ok, I discovered this:
no matter how many threads I start, there's only one instance of the policy object. So I put a boolean check and if it was true, it sets it falseit and does what it has to do to the protection domain and then sets it true again and returns. This made it so that it would only re-enter once.
 
 
subject: Endless Loop from Security Check
 
Threads others viewed
java .security .AccessControlException
is this security ok?
Probably a stupid question, the benefit of policy files?
Weird Policy Sub-class result - why?
How make true Singleton, even if loaded by Class.forName?
developer file tools