Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Visibroker 3.4 and OrbixWeb 3.2

2 views
Skip to first unread message

APV

unread,
May 1, 2003, 9:28:05 PM5/1/03
to
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)
=================================================================

0 new messages