Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

After implement security manager, local access to data is denied.

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After I implemented the System.SecurityManager, My local access model was denied. My local operation had worked every aspects before I added the security manager and Permission file.
Anybody has knowledge on this matter please help!
Thanks with great respects,
Ruilin
 
Dave Boden
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, the RMI Security Manager disallows everything by default. If you want to be clever, just give the application rights to handle db.db. For simplicity's sake, I have just given File access to <ALL> (i.e. the app can look at any file on the disk).
1. Use the "policytool" application provided as part of the JDK to create a .policy file.
2. User java -Dpolicy="c:\mypolicyfile.policy" or something similar to load the app with your security policy in place.
Hope this helps... Read the JavaDoc on RMI Security Manager if there are any further problems.
Dave
 
Dave Boden
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, you might have already done this.
If so, accept my apologies, I'm outta ideas ;-)
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
Thanks a lots.
I solved the local access problem by adding "FilePermission".
You comments is useful.
Best regards,
Ruilin
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on Remote access with RMI.
I got the following problems:
1) the server program can not stay. After start to run, it quickly exit without error message.
2) After start the client program, I got error message:
java.rmi.NotBoundException: RemoteDataService (which is my remote interface).
3) Can the methods of the remote interface throw not only RemoteException, but also other exceptions, (e.g. DatabaseException) ? Or the methods are only allowed to throw RemoteException?
My methods in the remote interface and the Implement class throw both RemoteException and DatabaseException. Do you think this is the problem?
Your comments are greatly respected.
Thanks,
Ruilin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic