File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes question about rmi registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "question about rmi registry" Watch "question about rmi registry" New topic

question about rmi registry

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
i write a simple interface "",i want to call it by rmi,after "javac","rmic","rmiregistry",i want to start "RMIServer.class" that is used to register in the server,see my code:
class RMIServer{
private static final int PORT=1099;
private static final String HOSTNAME="";
public RMIServer()
throws RemoteException,
System.out.println("registry:"+HOSTNAME+" in "+(Integer.toString(PORT)));
Hello h=new HelloImpl();
System.out.println("remote object has be created");
String urlString="//"+HOSTNAME+":"+Integer.toString(PORT)+"/HelloService";
System.out.println("binding finished");
main(String argv[]){
System.setSecurityManager(new RMISecurityManager());
RMIServer rs=new RMIServer();
}catch(Exception e){
i type"java RMIServer",it tell me:
==================================================java.rmi.server.ExportException: Port already in use: 1099; nested exception is: Address already in use: JVM_Bind
then i modify the port number to "10002",it said:
registry: in 10002
remote object has be created access denied ( connect,resolve)
who can tell me why?
thanks alot
I agree. Here's the link:
subject: question about rmi registry
It's not a secret anymore!