• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

policy file

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use RMI in my design and create two policy file for client side and server side.
here are the client side policy file:


grant {
permission java.net.SocketPermission "*:1024-65535","connect,accept";
permission java.io.FilePermission
"c:\\server\\exported_classes\\-", "read";
permission java.io.FilePermission
"c:\\client\\exported_classes\\-", "read";
};


here are the server side policy file:


grant {
permission java.net.SocketPermission "*:1024-65535","connect,accept";
permission java.io.FilePermission
"c:\\server\\suncertify\\db\\-", "write";
permission java.io.FilePermission
"c:\\server\\exported_classes\\-", "read";
permission java.io.FilePermission
"c:\\client\\exported_classes\\-", "read";
};


It seems that client must know where the server located its exported classes and the server must know where the client will put the exported classes, right? and it seems I have to setup this way to run the program correcly.
whether I misunderstood sth?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you package your server and client into two seperate executable jar files you will need to include the _stub classes in the client jar file.
The stub classes are not being dynamically loaded as we can not presume the server machine is running an http server.
I only used a policy file on the server side, as I thought that it was wise to specify exactly which ports and file a client could access. On the client side I didn't see this as necessary.
I did however lose two points on general considerations but believe that was because I didn't include a clean shutdown method for the server which I lost four points on.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic