Re: Connection Refused Exceptions

Gregg Wonderly <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Rick Moynihan wrote:
> I'm using RMI to communicate between the proxy and the service, and I
> suspect the problem is that the proxy's RMI stub to the
> UnicastRemoteObject is stale because of the restart.  However, upon
> restart my services all register back with the lookup service through
> the JoinManager.   Though my knowledge of RMI is sketchy, I would have
> thought that this process would ensure that a new proxy/stub was
> registered on the lookup service.
>
>
> Does anyone have any ideas on what might be causing the problem?  Any
> help would be highly appreciated.

The registration of services is primarily driven by unique ServiceID values. If
your reregistration is not with the same ServiceID, then your registration will
be added to the set of registered services, and not replace a particular
registration.  Lease expiration will eventually cause registrations to be
removed from the registrars content so that you won't see these "dead" entries.

So, if you don't have a registered shutdown hook in the services' VMs that will
be able to successfully shutdown your join manager, or if the service dies
unexpectedly in a way that keeps the shutdown hook from running, then the
service registration will remain until the lease expires, or it is replaced with
a new registration for a service with the same serviceID.

There are also facilities in JERIs endpoint configuration to used preassigned
ports for the endpoints and preassigned object identifiers in the exporter so
that a particular service will always be exported with the same object
identifier at the invocation layer, and associated with an endpoint that is
always on the same port.

If you use that facility, then stale registration info becomes less of an issue,
and if the service is running, clients should be able to use it.

Gregg Wonderly

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.