🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.corba
Article #45

Visibroker 3.4 and OrbixWeb 3.2

#45
From: APV
Date: Fri, 02 May 2003 01:28
270 lines
9386 bytes
Hi,

I am trying to communicate between a Java 1.3 corba server written in
OrbixWeb3.2 and a Visigenic 3.4 corba Java 1.4 client. I am using
Naming service IOR to achieve this.

I am able to get the inter ORB comm to work only when I DO
NOTexplicitly set the
org.omg.CORBA.ORBClass                     to     
com.visigenic.vbroker.orb.ORB
and org.omg.CORBA.ORBSingletonClass to com.visigenic.vbroker.orb.ORB

I want the inter-ORB to work when I set the above ORB classes and make
the
necessary changes to the Client code. Any suggestions on making this
work
(to the 2nd code below) is really appreciated.


The following code works perfectly fine  with the following command
======================================================
/usr/j2se/bin/java -Xbootclasspath:/usr/j2se/jre/lib/rt.jar -classpath
~/tlc/iiop/person_visi/classes:/opt/vbroker/lib/vbjapp.jar:/opt/vbroker/lib/vbjorb.jar:
/opt/vbroker/lib/vbjcosnm.jar:/opt/vbroker/lib/vbjcosev.jar:
/usr/j2se/lib/swingall.jar:/usr/j2se/jre/lib/rt.jar
Demos.namesStaff.Client

Note: Here the ORB used is a Java 1.4 implementation.
=======================================
package Demos.namesStaff;
 
import java.io.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.SystemException;
import org.omg.CosNaming.NamingContextPackage.* ;
import Demos.namesSpace.*;
 
public class Client {
 
  static NamingContext rootContext = null;
  static Person personRef = null;
 
  public static void main(String[] args)
{
  String rootIOR = null;
  org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
 
  try {
    BufferedReader br = new BufferedReader(new InputStreamReader(new
FileInputSt
ream("/tmp/ns.ior"))); 
     rootIOR = br.readLine();
     br.close();
   } catch (IOException e) {
     System.out.println(e);
   } 
 
    try {
       org.omg.CORBA.Object initNCRef = orb.string_to_object
(rootIOR);
       rootContext = NamingContextHelper.narrow (initNCRef);
    }
    catch (SystemException se) {
       System.out.println ("Exception during string to object
conversion : " + s
e.toString());
       System.exit (1);
    }
 
    NameComponent[] name = new NameComponent[4] ;
    org.omg.CORBA.Object objRef = null;

try {
      /*
       * Resolve name 'staff.john' using the first method described.
       */
      name[0] = new NameComponent ("IT_Demo", "");
      name[1] = new NameComponent ("Names", "");
      name[2] = new NameComponent ("Staff", "");
      name[3] = new NameComponent ("John","") ; 
 
      objRef = rootContext.resolve (name);
      personRef = PersonHelper.narrow (objRef);
      printDetails (personRef);
    }
    catch (InvalidName se) {
      System.out.println ("Exception - InvalidName : " +
se.toString());
      System.exit (1);
    }
    catch (CannotProceed se) {
      System.out.println ("Exception - CannotProceed : " +
se.toString());
    catch (InvalidName se) {
      System.out.println ("Exception - InvalidName : " +
se.toString());
      System.exit (1);
    }
    catch (CannotProceed se) {
      System.out.println ("Exception - CannotProceed : " +
se.toString());
      System.exit (1);
    }
    catch (NotFound se) {
      System.out.println ("Exception - Context NotFound : " +
se.toString());
      System.exit (1);
    }
    catch (SystemException  se) {
      System.out.println ("Unexpected system exception : " +
se.toString());
      System.exit (1);
    }
}
  public static final void printDetails ( Person p ) 
  {
    System.out.println ("\n-------------- Person Details
----------------");
    try {
      System.out.println ("Name          : " + p);
//      System.out.println ("Job Title     : " + p.job_title() );
    } 
    catch (org.omg.CORBA.SystemException  se) {
      System.out.println ("Exception during object_to_string : " +
se.toString()
);
            System.exit (1);
    }
  }
}
========================================================

The following code does NOT work with the following command 

/usr/j2se/bin/java -Xbootclasspath:/usr/j2se/jre/lib/rt.jar -classpath
.:~/tlc/iiop/person_visi/classes:/opt/vbroker/lib/vbjapp.jar:
/opt/vbroker/lib/vbjorb.jar:/opt/vbroker/lib/vbjcosnm.jar:
/opt/vbroker/lib/vbjcosev.jar:/usr/j2se/lib/swingall.jar:/usr/j2se/jre/lib/rt.jar
-Dorg.omg.CORBA.ORBClass=com.visigenic.vbroker.orb.ORB
-Dorg.omg.CORBA.ORBSingletonClass=com.visigenic.vbroker.orb.ORB
Demos.namesStaff.Client

Note: Here I am trying to make sure I am using the Visibroker ORB.
=====================================
package Demos.namesStaff;
 
import java.io.*;
 
import org.omg.CORBA.ORB;
import org.omg.CosNaming.*;
import org.omg.CORBA.SystemException;
import org.omg.CosNaming.NamingContextPackage.* ;
import Demos.namesSpace.*;
import com.visigenic.vbroker.orb.*;
import com.inprise.vbroker.CORBA.portable.ObjectImpl;
 
public class Client {
 
  static NamingContext rootContext = null;
  static Person personRef = null;
  static com.visigenic.vbroker.orb.ORB orb = null;
 
  public static void main(String[] args)
{
  String rootIOR = null;
 
  orb = (com.visigenic.vbroker.orb.ORB)org.omg.CORBA.ORB.init(args,
null);
 
  try {
    BufferedReader br = new BufferedReader(new InputStreamReader(new
FileInputSt
ream("/tmp/ns.ior"))); 
     rootIOR = br.readLine();
     br.close();
   } catch (IOException e) {
     System.out.println(e);
   } 
 
    try {
       org.omg.CORBA.Object initNCRef = orb.string_to_object
(rootIOR);
 
  try {
    BufferedReader br = new BufferedReader(new InputStreamReader(new
FileInputStream("/tmp/ns.ior")));
     rootIOR = br.readLine();
     br.close();
   } catch (IOException e) {
     System.out.println(e);
   } 
 
    try {
       org.omg.CORBA.Object initNCRef = orb.string_to_object
(rootIOR);
       rootContext = NamingContextHelper.narrow (initNCRef);
    }
    catch (SystemException se) {
       System.out.println ("Exception during string to object
conversion : " + se.toString());
       System.exit (1);
    }

    NameComponent[] name = new NameComponent[4] ;
    org.omg.CORBA.Object objRef = null;
 
    try {
      /*
       * Resolve name 'staff.john' using the first method described.
       */
      name[0] = new NameComponent ("IT_Demo", "");
      name[1] = new NameComponent ("Names", "");
      name[2] = new NameComponent ("Staff", "");
      name[3] = new NameComponent ("John","") ; 
 
      System.out.println("Created Name Component");
      objRef = rootContext.resolve (name);
      System.out.println("resolved name");
      personRef = PersonHelper.narrow (objRef);
      printDetails (personRef);
    }
    catch (InvalidName se) {
      System.out.println ("Exception - InvalidName : " +
se.toString());
      System.exit (1);
    }
    catch (CannotProceed se) {
      System.out.println ("Exception - CannotProceed : " +
se.toString());
      System.exit (1);
    }
    catch (NotFound se) {
      System.out.println ("Exception - Context NotFound : " +
se.toString());
      System.exit (1);
    }
    catch (SystemException  se) {
      System.out.println ("Unexpected system exception : " +
se.toString());
      se.printStackTrace();
      System.exit (1);
    }

  public static final void printDetails ( Person p ) 
  {
    System.out.println ("\n-------------- Person Details
----------------");
    try {
      System.out.println ("Name          : " + p);
//      System.out.println ("Job Title     : " + p.job_title() );
    } 
    catch (org.omg.CORBA.SystemException  se) {
      System.out.println ("Exception during object_to_string : " +
se.toString());
            System.exit (1);
    }
  } 
 
}

I am getting the following error :
=============
Unexpected system exception : org.omg.CORBA.NO_IMPLEMENT:   vmcid: 0x0
 minor code: 0  completed: No
org.omg.CORBA.NO_IMPLEMENT:   vmcid: 0x0  minor code: 0  completed: No
        at org.omg.CORBA.portable.Delegate.releaseReply(Delegate.java:347)
        at org.omg.CORBA.portable.ObjectImpl._releaseReply(ObjectImpl.java:474)
        at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:257)
        at Demos.namesStaff.Client.main(Unknown Source)
=================================================================
Technical Details
Message-ID: <e6e85890.0305011728.58541ba9@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108bbb,43238a9bb4d3ef3c,start
X-Google-Attributes: gid108bbb,public
X-Google-Thread: 109156,43238a9bb4d3ef3c,start
X-Google-Attributes: gid109156,public
X-Google-Thread: f753e,43238a9bb4d3ef3c,start
X-Google-Attributes: gidf753e,public
X-Google-ArrivalTime: 2003-05-01 18:28:07 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: anil_varma_is@yahoo.com (APV)
Newsgroups: comp.lang.java.corba,comp.object.corba,borland.public.visibroker
Subject: Visibroker 3.4 and OrbixWeb 3.2
Date: 1 May 2003 18:28:05 -0700
Organization: http://groups.google.com/
Lines: 270
Message-ID: <e6e85890.0305011728.58541ba9@posting.google.com>
NNTP-Posting-Host: 166.50.129.45
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1051838885 8476 127.0.0.1 (2 May 2003 01:28:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 2 May 2003 01:28:05 GMT