reset password
Author Message
lishenyu
Posts: 103
Posted 18:40 Nov 11, 2015 |

hi Dr sun,

at first I run the server and client ,it works fine. and after I do this many times to test, an exception occurred:

java.sql.SQLException: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
 java.net.ConnectException: Connection refused: connect
 at simpledb.remote.SimpleDriver.connect(SimpleDriver.java:36)
 at simpledb.client.SQLInterpreter.main(SQLInterpreter.java:13)
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
 java.net.ConnectException: Connection refused: connect
 at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
 at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
 at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
 at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
 at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
 at simpledb.remote.SimpleDriver.connect(SimpleDriver.java:31)
 ... 1 more
Caused by: java.net.ConnectException: Connection refused: connect
 at java.net.DualStackPlainSocketImpl.connect0(Native Method)
 at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
 at java.net.Socket.connect(Socket.java:589)
 at java.net.Socket.connect(Socket.java:538)
 at java.net.Socket.<init>(Socket.java:434)
 at java.net.Socket.<init>(Socket.java:211)

I have closed all server ,and even I restart eclipse ,it doesn't work ,could you tell me how to solve this ?thanks!

lishenyu
Posts: 103
Posted 18:44 Nov 11, 2015 |

o I solved it by changing back the port to "1099" . Maybe this program can only run on port 1099?