1.建立interface
package myRmi;import java.rmi.Remote;import java.rmi.RemoteException;
public interface RmiRemote extends Remote
{
public void getString()throws RemoteException;

}2.实现服务器package myRmi;import java.rmi.server.UnicastRemoteObject;import java.util.Vector;import java.rmi.Naming;import java.rmi.RemoteException;import java.rmi.RMISecurityManager;
public class ServerRmi extends UnicastRemoteObject implements RmiRemote
{
Vector v=new Vector();

String s="";

public ServerRmi()throws RemoteException
{
super();
try
{
//System.setSecurityManager(new RMISecurityManager());
// System.out.println("security has been set");

Naming.rebind("//pengwei.",this);//pengwei.是我的计算机名~
System.out.println("ServerRmi has been bind in registry");
}catch(Exception e){e.printStackTrace();}
}

public void getString()throws RemoteException
{
System.out.println("pengwei");
}

public static void main(String args[])
{
try
{
new ServerRmi();
    }catch(Exception e){e.printStackTrace();}
}
}用rmic生成了,skel和stup文件,但是用javaw rmiregistry,出现not find main class
问题,Naming.bind("",Object);请解释这个方法中的参数~!运行时出现java.rmi.ConnectionException:Connection refused to host:pengwei.;nested exception is:
java.net.ConnectionException:Connection refused:connect希望朋友们快点帮我解决~!