程序里面既然是用JNDI 来存放引用为什么还要启动 rmiregistry 服务呢 ProductImpl p1 = new ProductImpl("Blackwell Toaster");
ProductImpl p2 = new ProductImpl("ZapXpress Microwave Oven");Context namingContext = new InitialContext();
namingContext.bind("rmi:Toaster",p1);
namingContext.bind("rmi:Microwave",p2);改成
Product p1 = new ProductImpl("Blackwell Toaster");
Product p2 = new ProductImpl("ZapXpress Microwave Oven");
Rmiregistry registry = LocalRegistry.getRegistry() ;
registry .bind("rmi:Toaster",p1);
registry .bind("rmi:Microwave",p2);
还有一些安全Manager要设置最好先看看完整的文档 再动手
ProductImpl p2 = new ProductImpl("ZapXpress Microwave Oven");Context namingContext = new InitialContext();
namingContext.bind("rmi:Toaster",p1);
namingContext.bind("rmi:Microwave",p2);改成
Product p1 = new ProductImpl("Blackwell Toaster");
Product p2 = new ProductImpl("ZapXpress Microwave Oven");
Rmiregistry registry = LocalRegistry.getRegistry() ;
registry .bind("rmi:Toaster",p1);
registry .bind("rmi:Microwave",p2);
还有一些安全Manager要设置最好先看看完整的文档 再动手
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货