Object objref =(Object)ict.lookup("CalculatorBean/remote");
(CalculatorBean) PortableRemoteObject.narrow(objref,
            CalculatorBean.class);

解决方案 »

  1.   

    Object objref =(Object)ict.lookup("CalculatorBean/remote");
    (CalculatorBean) cal = PortableRemoteObject.narrow(objref,
                CalculatorBean.class);
      

  2.   

    哦,谢谢,知道问题了!原来这里Calculator cal=(CalculatorBean)ict.lookup("CalculatorBean/remote");
    应该这样写Calculator cal=(Calculator)ict.lookup("CalculatorBean/remote");
    不能强制转化为Bean,应转化为接口