2015-04-08 146 views
0

所以我已經閱讀了類似的問題,但我還沒有找到任何我完全理解的東西。Java.rmi.ConnectException:連接拒絕主機:localhost

http://www.coderanch.com/t/487650/java/java/java-rmi-ConnectException-Connection-refused

http://protegewiki.stanford.edu/wiki/Troubleshooting_Client_Server_Connections

what is RMI registry

http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/faq.html#domain

我有它每隔幾天崩潰的服務器,我試圖找出問題所在。該軟件運行在客戶提供的環境中,我需要知道我們是否是問題或Windows /網絡。

我的問題是... RMI註冊表,是java創建的東西還是它存在於Windows中的東西?爲什麼到localhost的連接會突然變得不可用或被拒絕?有什麼我可以做的立即排除故障?

的RMI配置是在這裏:

<RMIService> 
     <class>com.s.i.system.RMIService</class> 
     <server name="Server"> 
      <host>localhost</host> 
      <timeout>0</timeout> 
     </server> 
    </RMIService> 

這裏是在日誌中創建錯誤。

2015-04-02 16:52:10,057 ERROR [main] com...........gui.initialise.ClientInitialise - java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
java.net.ConnectException: Connection refused: connect 
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source) 
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source) 
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source) 
at sun.rmi.server.UnicastRef.newCall(Unknown Source) 
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) 
at java.rmi.Naming.lookup(Unknown Source) 
at com.s.i.system.RMIService.lookup(RMIService.java:570) 
at com.s.i.system.RMIService.lookupServer(RMIService.java:377) 
at com.s.i.process.RemoteRequestHandler$Dispatcher.run(RemoteRequestHandler.java:282) 
at com.s.i.process.RemoteRequestHandler$Dispatcher.start(RemoteRequestHandler.java:269) 
at com.s.i.process.RemoteRequestHandler.handle(RemoteRequestHandler.java:96) 
at com.s.i.process.RequestDispatcher.dispatch(RequestDispatcher.java:136) 
at com.s.i.client.ClientInitialiser.initialiseEnvironment(ClientInitialiser.java:498) 
at com.s.i.client.ClientInitialiser.performEnvironmentInit(ClientInitialiser.java:145) 
at com.s.i.client.ClientInitialiser.initialise(ClientInitialiser.java:128) 
at com.s.i.client.ClientInitialiser.initialise(ClientInitialiser.java:106) 
at com.s.i.gui.initialise.ClientInitialise.createInitialiser(ClientInitialise.java:136) 
at com.s.i.gui.initialise.ClientInitialise.<init>(ClientInitialise.java:155) 
at com.s.i.client.Client.initialise(Client.java:118) 
at com.s.i.client.Client.main(Client.java:147) 
Caused by: java.net.ConnectException: Connection refused: connect 
at java.net.PlainSocketImpl.socketConnect(Native Method) 
at java.net.PlainSocketImpl.doConnect(Unknown Source) 
at java.net.PlainSocketImpl.connectToAddress(Unknown Source) 
at java.net.PlainSocketImpl.connect(Unknown Source) 
at java.net.SocksSocketImpl.connect(Unknown Source) 
at java.net.Socket.connect(Unknown Source) 
at java.net.Socket.connect(Unknown Source) 
at java.net.Socket.<init>(Unknown Source) 
at java.net.Socket.<init>(Unknown Source) 
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source) 
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source) 
... 20 more 

回答

1

RMI註冊表是JRE的組件,而不是Windows的組件。顯然它正在崩潰,或者由於某種原因,它可能被錯誤地關閉。我從未在18年內看到RMI Registry的崩潰。

相關問題