If you look in ‘start-reggie.config’, around line 9 or 10, you’ll see two calls 
to ‘ConfigUtil.getHostName()’.  If you change those to 
‘ConfigUtil.getHostAddress()’, then the codebase string will use the IP address 
rather than the host name, as you describe below.

Cheers,

Greg Trasuk.

On Feb 18, 2015, at 6:09 AM, Bishnu Gautam <bishn...@hotmail.com> wrote:

> Hi Peter
> 
> We are trying to deploy River in Raspberry pi. We were successful to deploy 
> it however need to tweak few other things in order to utilize this platform 
> more precisely. 
> Our problem is that we need to run the reggie and need to return IP address 
> rather than domain name in order to run our client from other machine. 
> Whenever we run our server, client, regggiee etc in the same machine it works 
> fine. But when we run our client program from other machine, it could not 
> resolve the domain name as the  server name (Where reggies runs)  is not 
> recorded into our DNS records. So, we tweaked the hostname of the server and 
> changed it to IP address, in that case it works successfully. However, we do 
> not want our users change their hostname into ip address in order to make it 
> workable. 
> 
> So, we would like to tweak the config file of Reggie. The current config file 
> does not return IP address. We tried to change it by changing 
> ConfigUtil.getHostName() to ConfigUtil.getHostAddress(), but it still returns 
> the hostname. I have attached 2 files. One of which started and showing IP 
> address. In this case we changed our hostname (/etc/hostname file) to IP 
> address. It works fine but as  I mentioned above, in this case, user needs to 
> change his/her hostname to IP address which we do not want to demand.  And 
> the other file is the hostname without change and this makes problem if we 
> run our client from separate machine. 
> 
>  Do you have any other methods so that it runs successfully and return IP 
> address. I think the config file of start-reggie.config located at 
> example/hello/config/start-reggie.config has following codes. Thank you very 
> much for your help in this regards
> 
> *********************************
> import com.sun.jini.config.ConfigUtil;
> import com.sun.jini.start.NonActivatableServiceDescriptor;
> import com.sun.jini.start.ServiceDescriptor;
> 
> com.sun.jini.start {
> 
>     private static codebase =
>         ConfigUtil.concat(
>             new Object[] {
>                 "http://";, ConfigUtil.getHostName(), ":8080/reggie-dl.jar",
>                 " ",
>                 "http://";, ConfigUtil.getHostName(), ":8080/jsk-dl.jar" } );
>     private static policy = "config${/}reggie.policy";
>     private static classpath = "..${/}..${/}lib${/}reggie.jar";
>     private static config = "config${/}jrmp-reggie.config";
> 
>     static serviceDescriptors = new ServiceDescriptor[] {
>         new NonActivatableServiceDescriptor(
>             codebase, policy, classpath,
>             "com.sun.jini.reggie.TransientRegistrarImpl",
>             new String[] { config })
>     };
> 
> }//end com.sun.jini.start
> 
> ******************************

Reply via email to