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

RMI - java.security issue

 
Jeremy Quartey
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people!
Can anyone tell me why I keep getting the following errors when trying to run a look up service on RMI
My java.policy file contents are:
grant
{ //Allow everything
permission java.security.AllPermission;
};
The Jbuilder 4 VM parameters are:
-Djava.rmi.server.codebase=file:///C:\M879\jbuildercode\C9Code\9.1\classes\NameServer\
Part of the LookupService code is
import java.rmi.*;
public interface LookupService extends Remote{
//Gets name of computer given its IP address
String getName(String ipAddress) throws RemoteException;
}
LookupServiceImpl
C:\JBuilder4\jdk1.3\bin\javaw -classpath "C:\M879\jbuildercode\C9Code\9.1\classes\NameServer;C:\JBuilder4\jdk1.3\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilder4\jdk1.3\jre\lib\i18n.jar;C:\JBuilder4\jdk1.3\jre\lib\jaws.jar;C:\JBuilder4\jdk1.3\jre\lib\rt.jar;C:\JBuilder4\jdk1.3\jre\lib\sunrsasign.jar;C:\JBuilder4\jdk1.3\lib\dt.jar;C:\JBuilder4\jdk1.3\lib\tools.jar" -Djava.rmi.server.codebase=file:///C:\M879\jbuildercode\C9Code\9.1\classes\NameServer\ nameserver.LookupServiceImpl
Naming object set up...
Naming object populated...
Problem with server java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
Any help would be gratefully appreciated
Thanks
 
raimondas zemaitis
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to explicitly tell java about your policy file, my suspicion is JVM doesn't use your file
use -Djava.security.policy=<path_to_your_file>
 
Jeremy Quartey
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Raimondas - I shall experiment with your idea and get back to you
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic