Connecting Corba Client on NT computer to Corba Server on same compter

Connecting Corba Client on NT computer to Corba Server on same compter

Post by Michel Bergij » Wed, 04 Mar 1998 04:00:00



Hi,

I am trying to connect a Corba Client on my NT-computer to a Corba Server
on the same Computer.
I am developing a distributed database test application in Java, which will
synchronize the distributed
database by sending the information af a local update to the other database
site(s).

At this moment I am testing on one (1) computer.
By pinging I obtained the IP addres my computer. I started my Server with:
        java Test2 -ORBInitialHost 10.1.6.85 -ORBInitialPort 900 2
This Server is still grinding away, even while I am writing this question.

The Client I started with:
        java Test -ORBInitialHost 10.1.6.85 -ORBInitialPort 900 1
So both the Server and the Client have the same IP address. At a later
stage the test application
will run on two (or more) computers, with each a different IP-address.

When initializing the ORB I got a NullPointerException, meaning I try to
attempt to access a field or
invoke a method of a null object. This Exception beats me, though.

The important code of the Client's constructor is:
   public Client (String [] args) {

       String [] parameters = new String [5];
       parameters [0] = args [0];  // -ORBInitialHost
       parameters [1] = args [1];  // IP-address Server/Host
       parameters [2] = args [2];  // -ORBInitialPort
       parameters [3] = args [3];  // The port
         if (args [4].equals ("1"))
           name = "Receiver2";
       else name = "Receiver1";

       try {
           System.err.println ("Name class: "+ this.toString());
           System.err.println ("parameters are:");
           System.err.println ("parameters[0]: " + parameters[0]);
           System.err.println ("parameters[1]: " + parameters[1]);
           System.err.println ("parameters[2]: " + parameters[2]);
           System.err.println ("parameters[3]: " + parameters[3]);
           ORB orb = ORB.init (parameters, null);

At which place I encounter the NullPointerException. I thought this was the
right way to get things
done. But something is thinking differently. I am kind of fed up with, so I
appreciate some help.

Michel Bergijk

To email me, change myname to mbergijk.