I'm studying the same example from "Pro Spring" . If I run both client and server on the same machine, everything's ok, here is the print out from the server application:
Code:
信息: Looking for RMI registry at port '1099'
Host Started...
2006-6-28 15:25:22 org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
信息: CGLIB2 available: proxyTargetClass feature enabled
2006-6-28 15:25:22 org.springframework.remoting.rmi.RmiServiceExporter afterPropertiesSet
信息: Binding RMI service 'HelloWorld' to registry at port '1099'
And here is the print out from the client application running on the same machine with the server application:
Code:
2006-6-28 15:33:27 org.springframework.remoting.rmi.RmiClientInterceptor prepare
信息: RMI stub [rmi://172.16.6.108:1099/HelloWorld] is an RMI invoker
Hello World
Yet when I run the client application on another machine, i got following exception:
Code:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorldService' defined in class path resource [rmi/HellowWorldClient.xml]: Initialization of bean failed; nested exception is java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is:
java.net.ConnectException: Connection timed out: connect
java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is:
java.net.ConnectException: Connection timed out: 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)
Can somebody please tell me what's going wrong here?
Thanks very much.