aspose file tools*
The moose likes Distributed Java and the fly likes RMI binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI binding" Watch "RMI binding" New topic
Author

RMI binding

biruk naz
Greenhorn

Joined: Jun 21, 2008
Posts: 12
Hi all
I have some rmi(remote method invocation) application but when i execute it; It displays some error message.
The rmiregistry is started at port 1099(default)
Both the code and error message are posted bellow please help.


The error message is:
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve) and it points to the statement registry.bind("RemoteMediaServer", stub);
[ November 05, 2008: Message edited by: biruk naz ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
I'm not sure what this has to do with applets -which is what this forum is all about-, given that the code shows a "main" method (which is the hallmark of applications, not applets).

Why are you setting a security manager? It apparently prohibits this operation.


Ping & DNS - my free Android networking tools app
biruk naz
Greenhorn

Joined: Jun 21, 2008
Posts: 12
Actually i have an applet which reads data from a server side application,and the problem i post is about this server side application.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Hi Biruk, can you answer the following question from Ulf,

Why are you setting a security manager?


If you really do need to use the security manager then the ports you are using to export the remote objects must have permissions to connect.

If you are not aware of java policy file for specifying permissions, This article will help you.


apigee, a better way to API!
biruk naz
Greenhorn

Joined: Jun 21, 2008
Posts: 12
Sorry for the redundancy and ambiguity of my questioning.

Why are you setting a security manager?

Because the server side application needs to download classes from the clients.

I do have a security policy file:


Thank you all.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
Because the server side application needs to download classes from the clients.

Why does uploading files from the client to the server make it necessary to use a security manager on the server?

file:/project3/src/remoteinterface/

So you have loose class files in this directory? I'm asking because this file: descriptor will not work for jar files inside that directory. See the article Nitesh linked to for more detail.
[ November 10, 2008: Message edited by: Ulf Dittmer ]
biruk naz
Greenhorn

Joined: Jun 21, 2008
Posts: 12

Why does uploading files from the client to the server make it necessary to use a security manager on the server?


If an RMI program does not install a security manager, RMI will not download classes (other than from the local class path) for objects received as arguments or return values of remote method invocations.

And i have no .jar file in the directory only .class files

Thank you for your help
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

biruk:
If an RMI program does not install a security manager, RMI will not download classes (other than from the local class path) for objects received as arguments or return values of remote method invocations.


I believe that is true for clients and not servers.
Here is a related article on dynamic classloading and its nuances
biruk naz
Greenhorn

Joined: Jun 21, 2008
Posts: 12

I believe that is true for clients and not servers.


It worked!! that was my problem.

Thank you very much
 
Don't get me started about those stupid light bulbs.
 
subject: RMI binding