作者NightPrince (shooting star)
看板java
标题Re: [问题] RMI
时间Sat Mar 18 15:38:42 2006
问题已经被我神奇的解决掉,打扰各位真不好意思 (光速逃)
XD
[local save]
※ 引述《NightPrince (shooting star)》之铭言:
: ※ 引述《NightPrince (shooting star)》之铭言:
: : 我写了一个简单的RMI程式,
: : 部分程式码如下:
: : LocateRegistry.createRegistry(1099);//启动registry server
: : String serverObject = "rmi://localhost/serverObject";
: : Naming.rebind(serverObject,temp);
: : 在rmi://那,我如果写localhost就没问题
: : 写 domain name 就会有问题,我LAB的DN是 blue.iim.ncku.edu.tw
: : 也就是 rmi://blue.iim.ncku.edu.tw/serverObject
: : LAB只有一个public IP Addr. ,所以LAB所有的电脑都是使用
: : Class C private IP Addr. 然後透过那个 public IP Addr. 连上网路
: : 以往,我要用我电脑架站,只要去 IP 分享器设定我这个 private IP Addr.
: : 要用那个PORT架设,就把那个port对应到我这个 private IP Addr. 即可
: : 1099 port 我已经设定对应到我这个 private IP Addr. ,结果打上DN
: : 就无法运作,不知我哪里出了问题?
: 顺便附上错误讯息 XD
: Exception in thread "main" java.rmi.ServerException: RemoteException occurred
: in server thread; nested exception is:
: java.rmi.AccessException: Registry.Registry.rebind disallowed; origin
: /140.116.96.181 is non-local host
: at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
: at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
: at sun.rmi.transport.Transport$1.run(Unknown Source)
: at java.security.AccessController.doPrivileged(Native Method)
: at sun.rmi.transport.Transport.serviceCall(Unknown Source)
: at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
: at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
: at java.lang.Thread.run(Unknown Source)
: at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
: Source)
: at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
: at sun.rmi.server.UnicastRef.invoke(Unknown Source)
: at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
: at java.rmi.Naming.rebind(Unknown Source)
: at songServerImpl.main(songServerImpl.java:67)
: Caused by: java.rmi.AccessException: Registry.Registry.rebind disallowed;
: origin /140.116.96.181 is non-local host
: at sun.rmi.registry.RegistryImpl.checkAccess(Unknown Source)
: at sun.rmi.registry.RegistryImpl.rebind(Unknown Source)
: at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
: at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
: at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
: at sun.rmi.transport.Transport$1.run(Unknown Source)
: at java.security.AccessController.doPrivileged(Native Method)
: at sun.rmi.transport.Transport.serviceCall(Unknown Source)
: at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
: at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
: at java.lang.Thread.run(Unknown Source)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.116.96.181