• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

policy file question

 
Andre Mermegas
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all, i really havent had any experience with
policy file, do you think it would be appropriate
to just include the default java.policy that
came with JDK? I really havent played much with
policy stuff.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would pull out all the PropertyPermission elements simply because they aren't releveant to the client-server interaction. And, since you're not being timed as part of your code evaluation, it certainly wouldn't hurt to learn a little about the range of permissions available.
For starters, run policytool -- it's good for making changes to the policy file without worrying about typos.
Also, take a look at the JDK permissions page, for future reference if not for the exam.
 
Andre Mermegas
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael!
 
Andre Mermegas
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
having a problem, heres java.policy
-----------------------------------
grant codeBase "file:../dist/server.jar" {
// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "localhost:1024-", "listen";
permission java.io.FilePermission "../build/-","read";
};
here is error:
--------------
access denied (java.io.FilePermission \\..\build\suncertify\server read)
here is code that executes program
----------------------------------
java -Djava.security.policy=../etc/java.policy -Djava.rmi.server.codebase="file://../build/suncertify/server/" -jar ../dist/server.jar
I'm not sure why its having problems registering
with a previously running rmiregistry, it worked
before,but for the life of me, i cannot figure out what might have changed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic