river-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Meng <m...@hotmail.com>
Subject RE: Multicase problem.
Date Fri, 16 Oct 2009 04:18:25 GMT


Can any Jini developer who monitors this queue helps me out?

My code(attached below) is very simple, why does it try to lookup Javaspace service at local
host? If there is indeed some network misconfiguration, can any one give me any advice about
how to troubleshoot it?

connection refused or timed out to BasicObjectEndpoint[bfad5326-91ff-4cde-bc78-d03238dfdfbe,TcpEndpoint[]];
nested exception is: 
    java.net.ConnectException: Connection refused

public class SpaceAccessor {
    public static JavaSpace getSpace(String name) {
        try {
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new RMISecurityManager());
            if (System.getProperty("com.sun.jini.use.registry") 
                == null) 
                //Create a template to lookup the JavaSpaces service.
                Class [] types = new Class[]{JavaSpace.class};
                ServiceTemplate tmpl = new ServiceTemplate(null,types,null );

                // Locate the JavaSpaces service and create a JavaSpace proxy attached to
                LookupLocator locator = new LookupLocator("jini://s04");
                ServiceRegistrar sr = locator.getRegistrar();
                JavaSpace space =  (JavaSpace)sr.lookup(tmpl);  //got exception here.

                return space;

        } catch (Exception e) {
        return null;
Thanks a lot in advance!

From: mlq1@hotmail.com
To: river-user@incubator.apache.org
Subject: RE: Multicase problem.
Date: Wed, 14 Oct 2009 20:06:31 +0000


Here is what I got on server(s04) where LUS is running:

[root@s04 ~]# netstat -an | grep LISTEN
tcp        0      0      *                   LISTEN      
tcp        0      0     *                   LISTEN      
tcp        0      0       *                   LISTEN      
tcp        0      0        *                   LISTEN      
tcp        0      0     *                   LISTEN      
tcp        0      0      *                   LISTEN      
tcp        0      0 :::4160                     :::*                        LISTEN      

my /etc/hosts on the worker machine(s03)look like this:    s04.meng.com    s04    localhost.localdomain localhost    s03 s03    

My question is, if s03  can successfully get registrar back from s04, why does the registrar.lookup()
bind to localhost instead of s04? 


> Date: Wed, 14 Oct 2009 14:09:22 -0500
> From: gergg@cox.net
> To: river-user@incubator.apache.org
> Subject: Re: Multicase problem.
> This points at a common linux misconfiguration where the /etc/hosts file ends up 
> having bad values in it that map the hostname to and vice-versa.
> The end result is that the LUS binds to localhost instead of the interface 
> address for a network interface, and then tells you this is where it is bound, 
> which of course you can not connect to.
> If you will do a "netstat -an |grep LISTEN" on the server that the LUS is 
> running on, you should see that there is no external LISTEN on 4160, only a 
> localhost binding.
> You are finding the service via multicast, but then getting back an address that 
> you can't connect to it with I am guessing.
> Gregg Wonderly
> Patrick Wright wrote:
> > This reminds me of a situation where some of our BasicObjectEndpoints
> > were ending up with the loopback address. When a remote server would
> > try to contact on that endpoint, it of course wouldn't find us.
> > 
> > HTH
> > Patrick
> > 
Click less, mail more: Hotmail on the new MSN homepage! 		 	   		  
New! Faster Messenger access on the new MSN homepage
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message