oppalu
oppalu
2016-02-18 05:37
采纳率: 50%
浏览 1.9k
已采纳

java rmi连接本机问题

代码如下,然后就运行不出来Naming.rebind之后的那句sysout。也没有异常就是不运行,等了好几分钟还是运行不出来

try {
System.out.println("start active server...");
FinanceAccountDataService financeAccountDataService = new FinanceAccountDataImpl();
FinanceReportDataService financeReportDataService = new FinanceReportDataImpl();
FinanceSalaryDataService financeSalaryDataService = new FinanceSalaryDataImpl();
MealDataService mealDataService = new MealDataImpl();
MemberDataService memberDataService=new MemberDataImpl();
PersonnelDataService personnelDataService = new PersonnelDataImpl();
ProcessOrderDataService processOrderDataService = new ProcessOrderDataImpl();
UserDataService userDataService = new UserDataImpl();
WarehouseDataService warehouseDataService = new WarehouseDataImpl();

        LocateRegistry.createRegistry(6600);

        System.out.println("start register services...");
        Naming.rebind("rmi://localhost:6600/FinanceAccountDataService", financeAccountDataService);
        Naming.rebind("rmi://localhost:6600/FinanceReportDataService", financeReportDataService);
        Naming.rebind("rmi://localhost:6600/FinanceSalaryDataService", financeSalaryDataService);
        Naming.rebind("rmi://localhost:6600/MealDataService", mealDataService);
        Naming.rebind("rmi://localhost:6600/MemberDataService", memberDataService);
        Naming.rebind("rmi://localhost:6600/PersonnelDataService", personnelDataService);
        Naming.rebind("rmi://localhost:6600/ProcessOrderDataService", processOrderDataService);
        Naming.rebind("rmi://localhost:6600/UserDataService", userDataService);
        Naming.rebind("rmi://localhost:6600/WarehouseDataService", warehouseDataService);

        System.out.println("active server successfully!");
    } catch (Exception e) {
        System.out.println("fail to active server!");
        e.printStackTrace();
    }
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐