我剛剛開始運行RMI的第一個基本示例.. 處理很多問題我終於從客戶端和服務器端跑了ma項目,但是當我在不同的m/c上運行客戶端時,我得到了例外。遠程客戶端NotBoundException
Computeappengine exceptionCompute
java.rmi.NotBoundException: Compute
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:114)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:390)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at Client.computeappprog.main(computeappprog.java:21)
但是當客戶端和服務器在相同的m/c上運行時,沒有問題。 不得不提的VMware的,我的工具幫助有一個服務器M/C 所有的防火牆關閉....
我認爲客戶端無法查找目標服務器,這可能是關於網絡配置:\,或者您剛忘記在客戶端之前運行服務器:? – 2013-06-30 19:32:19
當客戶端無法查找服務器時,它給連接拒絕錯誤。 – pcc
@ user2511414絕對不是。看到例外。 – EJP