Re: NAT / Firewalls / Router / Grief

Thomas Vinod Johnson <[email protected]> Mon, 17 Mar 2008 10:04:24 -0400
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Cam Roe wrote:
>
> Hi all,
>
>  
>
> Just trying out River 2.1 and am working my way through some issues. 
>  I must admit to being very behind the times with regard to Jini after 
> 1.2 so apologize if this has been gone over before.  
>
>  
>
> Anyway, I have reggie and the httpserver running on one network and a 
> HelloService example running on a 2^nd network (Diagram below). When I 
> run an older reggie(1.2) or JMatos this works fine, but under the 2.1 
> I seem to have something not set correctly. I start the HttpServer, 
> Reggie and a ServiceBrowser (just for the heck of itJ  ) using the 
> bat/config files listed below. It seems to work fine … to a point. All 
> the services start up on on the left (LUS side on the diagram link) 
> and then I switch to the Service Provider side(other network) and try 
> to do a single lookup (using a single instance of a LookupLocator 
> aimed at psinaptic.com,4160
>
>  
>
> LookupLocator[] psill = {new LookupLocator("psinaptic.com", 4160)};
>
>  
>
> My HelloServiceRegistrationManager class constructs a JoinManager with 
> the single LookupLocator and tries to register the service. It also 
> implements the following:
>
>  
>
> public class HelloServiceRegistrationManager implements 
> ServiceIDListener, LeaseListener, DiscoveryListener {
>
>  
>
>  
>
> As such it has a discovered method (DiscoveryListener)
>
>  
>
> public void discovered(DiscoveryEvent e) {
>
>         ServiceRegistrar[] sr = e.getRegistrars();
>
>         for (int i = 0; i < sr.length; i++) {
>
>             try {
>
>                 logger.log(Level.INFO, "New LUS on " + 
> sr[i].getLocator().getHost() + " has been discovered.");
>
>             } catch (RemoteException ex) {
>
>                 logger.log(Level.SEVERE, "What the F.........", ex);
>
>             }
>
>         }
>
>  
>
>     }
>
>  
>
>  
>
> I get the following exception (as you guessed) being thrown from the 
> discovered method while running on pc 192.168.100.100
>
>  
>
> Mar 5, 2008 11:51:56 PM 
> com.psinaptic.examples.hello_joinmanager.HelloServiceRegistrationManager 
> discovered
>
> SEVERE: What the F.........
>
> java.rmi.ConnectException: connection refused or timed out to 
> BasicObjectEndpoint[05b3e9bd-3766-4d8b-a8f2-4ab8fcaa5651,TcpEndpoint[192.168.0.101:4089]]; 
> nested exception is:
>
>         java.net.ConnectException: Connection timed out: connect
>
>         at 
> net.jini.jeri.BasicInvocationHandler.wrapSafeIOException(BasicInvocationHandler.java:890)
>
>         at 
> net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:711)
>
>         at 
> net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
>
>         at 
> net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
>
>         at com.sun.jini.reggie.$Proxy0.getLocator(Unknown Source)
>
>         at 
> com.sun.jini.reggie.RegistrarProxy.getLocator(RegistrarProxy.java:215)
>
For this specific issue, the default 'serverExporter' for reggie will 
export a proxy that has a TcpEndpoint host name of 
InetAddress.getLocalHost(). You'll need to configure the exporter to use 
the TcpServerEndpoint host/port factory method in order to get a 
different host name. The unicastDiscoveryHost entry only applies to the 
multicast announcements and unicast discovery responses, not to the 
exported proxy.
>

--------------------------------------------------------------------------
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]