users@glassfish.java.net

Re: AccessControlException: access denied

From: <forums_at_java.net>
Date: Mon, 2 Apr 2012 10:36:50 -0500 (CDT)

Hi. It looks like your app is trying to make a call to get the database
password via getDbPassword() and it does not have permissions to. In order
for your app to make a call to this protected resource, I believe you will
need to explicitly have permissions granted your app by editing the
server.policy file so that it contains something like the following: grant
codeBase
"file:${com.sun.aas.instanceRoot}/applications/yourAppOrModuleName/-"{
permission java.lang.RuntimePermission "SSLPassword"; } I believe this should
help you get around the permission failure you are seeing. I am not saying
this is what you should do but am instead suggesting you be sure this is
really what you want to do. Also, check the codeBase setting - you probably
should be as specific as possible when listing the codebase to ensure you are
isolating who has that permission. Another thing to consider - why did it
work before and why does it not work now? Could be new enhancements and
tightening of security....I don't know just guessing. Hopefully someone more
knowledgable in this area will add more. hth, -paul

--
[Message sent by forum member 'phendley']
View Post: http://forums.java.net/node/884662