Bootstraping-IOR

Malte Mueller mamue@fbti.et-inf.fho-emden.de
Wed, 23 Jul 1997 11:18:38 +0200 (MET DST)


Hello,

> 1. How to get the IOR of omniNames into another ORB
> ***************************************************
> 
> I am using JavaIDL-ORB (EA) for clients and omniORB for the serverobjects. My question is now: How do I get the IOR of omniNames into the JavaORB? 
> I thought that IP-address and port-number (can be set as parameters) would be enough information for the Java-ORB to get contact to omniNames. But it did not work.
> As I see it at the moment, I have to write the stringified IOR of omniNames into a file, that is located on the webserver, so that it can be accessed by the JavaORB. The JavaORB then has to get an object by resolving the IOR it got via reading a textfile on the server.
> 
> Does anybody have any suggestions or remarks to that?
> (For your information I inserted the "pragma omg.org stuff" in omniNames. So it is not this problem...)
> 

We use the second approach. It looks something like that:
public String readIOR() 
  {
    InputStream iorInputStream = null;
    String input=null;
    try
    {
      iorInputStream = iorURL.openStream();
    }
    catch(IOException ioe)
    {
      ioe.printStackTrace(System.out);
    }

    DataInputStream iorDataInputStream = new DataInputStream(iorInputStream);
    try
    {
      input = iorDataInputStream.readLine();
    }
    catch(IOException ioe)
    {
      ioe.printStackTrace(System.out);
    }
    return input;
  }

For convenience we write the Stringified IOR of the server and the nameserver
to a defined file at startup with a little script like that:

#!/bin/sh
/usr/local/JavaIDL/bin/nameserv -ORBInitialPort 8088 > /home/mamue/javaIDL.log &
sleep 4
grep IOR /home/mamue/javaIDL.log > /home/mamue/javaIDL.ior
cd /home/mamue/programming/corba/java
/usr/local/jdk1.1.1/bin/java -classpath /usr/local/jdk1.1.1/lib/classes.zip:/usr
/local/JavaIDL/lib/classes.zip:. pictureServer -ORBInitialPort 8088 &
cd -

Hope this helped

Malte Mueller
mamue@server.et-inf.fho-emden.de
http://info.et-inf.fho-emden.de/~mamue