Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 3rd, 2003, 11:54 PM
conyuenlu conyuenlu is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 1 conyuenlu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy PLEASE HELP!! - RMI Example

I will firstly describe how my RMI example works fine WITHOUT a Security Manager. Then I will describe the problems when running WITH a Security Manager

WITHOUT A SECURITY MANAGER
The following files are included in directory C:\A\B\C\bank on machine C1
BankInterface.class
ASBBank.class (Remote object implementing BankInterface.class)
ASBBank_Skel.class
ASBBank_Stub.class
ATMServer.class

The following files are included in directory C:\D\E\F\bank on machine C2
BankInterface.class
ASBBank_Skel.class
ASBBank_Stub.class
ATMClient.class

Steps when run successfully without a security manager
On C1
1) Set classpath to c:\A\B\C
2) Go to c:\A\B\C
3) Type command: start rmiregistry 2010
4) Start server by: java bank.ATMServer C1:2010

On C2
1) Set classpath to c:\D\E\F
2) Go to c:\D\E\F
3) Type command: java bank.ATMClient C1:2010

Program works!!!

WITH A SECURITY MANAGER
When using a security policy file the following changes are made:-
On C1
1) ATMServer main method is changed to include following code:-
if(System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
2) Create security policy file c:\security\java.policy as follows:-

grant {
permission java.net.SocketPermission "*:1024-65535", "connect,accept";
};

Steps when run unsuccessfully
On C1
1) Go to c:\A\B\C
2) Type command: start rmiregistry 2010
3) Start server by: java –Djava.security.policy=c:\security\java.policy bank.ATMServer C1:2010
4) Result: Error – java.security.AccessControlException: access denied (java.net.SocketPermission C1 resolve)

QUERIES:
1)What am I doing wrong – how can I get the application to work?
2)Even if I got the server to work on C1, is it necessary to create a separate security policy for C2, as well as set a Security Manager in ATMClient similar to in ATMServer?
3)Could it be that other security policies (some also named java.policy) for other applications (such as WebLogic etc) on my machine are overriding my specific security policy file?

Any help would be very much appreciated, as I am getting very frustrated !

Reply With Quote
  #2  
Old July 18th, 2003, 03:28 PM
jgonte jgonte is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 jgonte User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try
grant {
permission java.net.SocketPermission "*:1024-65535", "connect,accept,resolve";
};

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > PLEASE HELP!! - RMI Example


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap