|
From: Palmer, D. <Dav...@ph...> - 2003-03-31 17:52:10
|
> Well, that means, that the registry doesn't stop to exist,
> when you stop
> the service. I don't know why or how you could kill the registry on
> stopping the service.
> But if you use the rebind method rebind(String name,
>
> Remote obj) you should get around this exception.
>
>
First, I just want to thank you for the help here. Its nice to see an active
developer community :) It is very much appreciated.
Second... ugh... okay. When trying to start my service now... I get:
INFO | jvm 1 | 2003/03/31 12:38:23 | getting ready to start logic
engine: rmi://localhost:12773/logicengine
INFO | jvm 1 | 2003/03/31 12:38:24 | java.rmi.ConnectException:
Connection refused to host: localhost; nested exception is:
INFO | jvm 1 | 2003/03/31 12:38:24 | java.net.ConnectException:
Connection refused: connect
INFO | jvm 1 | 2003/03/31 12:38:24 | java.net.ConnectException:
Connection refused: connect
...... snipped stack trace .......
Okay... this is pretty strange... at least to me anyway. Basically what I
have is a server "wrapper" class which starts the RMI registry, then
instantiates a Implementation class (the thing that extends
UnicastRemoteObject and implements the remote interface). This
implementation class does a rebind of the "service" name, which I pass in as
an argument:
------- RMIServer.java ------------
// full service name:
String serviceName = "rmi://"+host+":"+port+"/logic_engine";
// start rmi registry:
java.rmi.registry.LocateRegistry(new Integer(regPort).intValue());
// instantiate remote implementation class:
new RemoteLogicEngineImpl(serviceName);
------- end RMIServer.java --------
------- RemoteLogicEngineImpl.java ---------
public class RemoteLogicEngineImpl extendes UnicastRemoteObject implements
RemoteLogicEngineIntf {
public RemoteLogicEngineImpl (String service)
{
Naming.rebind(service_name, this);
}
.... exposed remote methods here....
}
-------- end RemoteLogicEngineImpl.java ---
Now... I have change the 'host' parameter from "localhost" to my hostname,
to the IP... all produce the same exception. I have tried different ports...
the same.
I'm just at a loss here. I *know* I am not doing something right. Ugh...
this is why I dislike dealing with 3rd party "blackbox" software.
./dave
"The sender believes that this E-mail and any attachments were free of any
harmful and malicious code or defects when sent. This message and its
attachments could have been infected during transmission. By reading the
message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action regarding the code
or such defects. The sender is not liable for any loss or damage arising in
any way from this message or its attachments."
|