Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4117378

ORB.init(String [] args, Properties properties) throws NullPointerException

XMLWordPrintable

    • beta3
    • x86
    • windows_nt
    • Not verified



      Name: rm29839 Date: 03/05/98


      I am trying to connect a Corba Client on my NT-computer to a Corba Server
      on another Computer. For my thesis 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).

      By pinging I obtained the IP addres of my Server 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 also started with:
      java Test -ORBInitialHost 10.1.6.85 -ORBInitialPort 900 1
      So the Client has the same IP address as the Server.

      When initializing the ORB I got a NullPointerException. A NullPointerException
      usually means a Programmers error, meaning me. But the problem is, I can connect
      the Client and Server with allmost the same code, when both Client and Server run
      on one computer. So this Exception beats me.

      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:
      Name class: Client@14354c34
      parameters are:
      parameters[0]: -ORBInitialHost
      parameters[1]: 10.1.6.85
      parameters[2]: -ORBInitialPort
      parameters[3]: 900
      Client exception: java.lang.NullPointerException:
      java.lang.NullPointerException:
      at com.sun.CORBA.iiop.ORB.findPropertiesFromArgs(ORB.java:325)
      at com.sun.CORBA.iiop.ORB.set_parameters(ORB.java:514)
      at org.omg.CORBA.ORB.init(ORB.java:201)
      at Client.<init>(Client.java:49)
      at Test.main(Test.java:16)
      Test: Sending message
      Client.sendMessage()
      Client.sendMessage(): message serialized
      java.lang.NullPointerException:
      at Client.sendMessage(Client.java:90)
      at Test.main(Test.java:20)

      Please e-mail me the answer.
      (Review ID: 25991)
      ======================================================================

            busersunw Btplusnull User (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: