Re: reggie started?

Gregg Wonderly <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Rikard Elofsson wrote:
> Hello all
>
> I start reggie from my application with:
>
> String[] args = { "config/jini/reggie/start-transient-reggie.config"};
> ServiceStarter.main(args);
>
> When I try to do a unicast lookup against it a little later I sometimes
> (on Windows) and always (on Linux) get a "Connection refused" exception
> but it works after that. I suppose it is because the reggie socket is
> not yet up? Is it possible to get rid of this nuisance and how?

I'd venture a guess that this is all about the timing.  If you would like, you
can do something like

while( true ) {
        try {
                new Socket( unicastHost, unicastPort ).close();
                break;
        } catch( ConnectException ex ) {
                log.log( Level.WARNING, ex.toString(), ex );
                Thread.sleep( 500 );
        }
}

between starting the service starter, and doing the lookup, and you should see
that the exception from SDM disappears, but you might see one or more of the
above exceptions.

I, personally, use unicast (usually "jini://locahost") as a backup to multicast,
everywhere, because multicast is not always on by default.  I'm not content that
this logging verbosity is appropriate from the SDM, given that this situation is
recoverable.  I removed the stack traces in my build of Jini and included more
information about the locator that is failing and changed the level to FINE (or
was it HANDLED).  If there is a discovery problem related to a missing LUS, that
will be visible enough.  This is an expected type of failure in an incompletely
configured system (wrong locator, or missing LUS).  So it might even be worth
logging this at the the CONFIG or HANDLED level.

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.