Originally Posted by corlettk
|
Care to be a little more forthcoming?
C'mon for FFS a "senior member" should know the drill by now. If you ask for help it's encumbent upon you to provide as much pertintant information as possible, to allow the helper(s) to identify the problem.
"It doesn't work" don't tell me diddy.
I'm out. GL.
Cheers. Keith.
|
Sorry about that; I think I was in the middle of the process coz after a while the error was displayed as:
|
Code:
|
Constructing server implementations...
Binding server implementations to registry...
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectExce
ption: Connection refused to host: 192.168.2.201; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.bind(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.bind(Unknown Source)
at javax.naming.InitialContext.bind(Unknown Source)
at ProductServer.main(ProductServer.java:34)
Caused by: java.rmi.ConnectException: Connection refused to host: 192.168.2.201;
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.bind(Unknown Source)
... 4 more
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 S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
... 9 more |
The ProductServer just doesn't start on its own, it needs a few services to run (I guess...sorry I might be a senior member but I'm still learning). So, I compiled the following batch file:
|
Code:
|
run_demo.bat
@echo off
rem demonstrates the use of calling a remote method
rem javac Product*.java
rmic -v1.2 ProductImpl 2> rmic.error.log
start rmiregistry 2>>rmic.error.log
start java ProductServer 2> ProductServer.log
java ProductClient
pause |
I've noted that the last line gives me an error unless I execute it on its own (i.e. open the console window and run
java ProductClient separately:
javax.naming.NameNotFoundException: toaster
at com.sun.jndi.rmi.registry.RegistryContext.lookup(U nknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup( Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at ProductClient.main(ProductClient.java:35)
Press any key to continue . . .