源代码:如下import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
import java.lang.Math;public class RmiTestServer extends UnicastRemoteObject implements RmiTest  {
  //调用UnicastRemoteObject的建构者函数
  RmiTestServer() throws RemoteException {
     super();  
  }
   //使用端把要计算的参数传过来在此作计算,之后再把结果返回
   public float getRmiTest(int r) throws RemoteException  {
      float circlerate = (float)(2*Math.PI*r);
      return circlerate;
   }   public static void main(String args[])  {
      //System.setSecurityManager(new RMISecurityManager());
      
      try  {
         Naming.rebind("//100.0.0.1:1443/RmiTestObj", new RmiTestServer());
        // Naming.rebind("RmiTestObj", new RmiTestServer());
         System.out.println("RMI Connecting..");
      } 
      catch (Exception e)  {
         System.out.println("RMI can't connect.. : " + e);
         System.exit(-1);
      }
   }
}
具体是什么错呢?
我搞不明白

解决方案 »

  1.   

    // CardLayoutManager.javaimport java.awt.CardLayout;
    import java.awt.Button;
    import java.awt.Event;public class CardLayoutManager extends java.applet.Applet  {
        final int ButtonNumber = 7;    public void init()  {
            int i;        // ³]©w¥~Æ[ºÞ²z­û¬° CardLayout
            setLayout(new CardLayout());
            // ²£¥Í²Õ¦¨³æ¤¸, ¥H¼Æ¦r¨Ó©R¦W
            for (i = 1;i <= ButtonNumber;i ++)
                add(String.valueOf(i), new Button("§&Uacute;&not;O&laquo;&ouml;&para;s #" + i));
            // &sup2;&Auml;¤@&shy;&Oacute;&Aring;&atilde;&yen;&Uuml;&ordf;&ordm;&not;O&sup2;&Auml; ButtonNumber/2 ±i&yen;d¤ù
            ((CardLayout)getLayout()).show(this,
                                    String.valueOf(ButtonNumber / 2));
        }    public boolean action(Event evt, Object what)   {
            // &yen;u±&micro;¨ü Button &copy;&Ograve;&sup2;&pound;&yen;&Iacute;&ordf;&ordm;¨&AElig;&yen;ó ACTION_EVENT
            if (evt.target instanceof Button)   {
                // ¤&pound;&ordm;&THORN;&not;O&shy;&thorn;¤@&shy;&Oacute;&laquo;&ouml;&para;s&sup3;Q&laquo;&ouml;¤U, &sup3;&pound;&Acirc;&frac12;¨ì¤U±i&yen;d¤ù&iexcl;C
                ((CardLayout)getLayout()).next(this);
                return true;
            }
            else
                return false;
        }
    }RmiTest 已经编译通过了
      

  2.   

    RmiTest是自己写的interface还是import的,他所在的package有import进来么?
      

  3.   

    import java.rmi.*;public interface RmiTest extends java.rmi.Remote {  public float getRmiTest(int r) throws RemoteException;
      
    }
    RmiTest  已经编译通过了