VisiBroker for Java 2.5 client to omniORB?

John Connett jrc@art.co.uk
Thu, 17 Jul 1997 15:45:29 +0100


As a first step towards teaching myself a bit more about CORBA and Java
I tried to translate eg2_clt from C++ to Java.  Unfortunately, my
attempt blows up almost immediately somewhere deep down in the depths of
code called from string_to_object.

I'm using omniORB_2.2.0 running eg2_impl as the server, the demo version
of vbj_2.5 for Java stubs and support, and jdk-1.1.1v3-2.i386.rpm as the
source of the Java language tools.  All of it running on Redhat Linux
4.2 on an Intel Pentium.  The C++ version of eg2_clt responds as
expected when given the IOR emitted by eg2_impl.  Here's enough Java to
demonstrate the problem:

public class eg2_clt {
  public static void main(String args[]) {
    try {
      // Initialize the ORB.
      org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
      org.omg.CORBA.Object obj = orb.string_to_object(args[0]);
      System.out.println("Contacted object: " + obj);
    }
    catch(org.omg.CORBA.SystemException e) {
      System.err.println(e);
    }
  }
}

[jrc@skylon echo]$ javac eg2_clt.java
[jrc@skylon echo]$ java eg2_clt
'IOR:01cc00400d00000049444c3a4563686f3a312e3000ab0d08010000000000000024000000010100000a0000003132372e302e302e31000a040c00000033cddc432c48c19e00000001'
org.omg.CORBA.INTERNAL[completed=MAYBE, reason=Invalid delimiter "^@"]
        at
com.visigenic.vbroker.ds.IStream.read_Resource(IStream.java:131)
        at com.visigenic.vbroker.ds.DSUser.doInvoke(DSUser.java:196)
        at com.visigenic.vbroker.ds.DSUser.invoke(DSUser.java:216)
        at com.visigenic.vbroker.ds.DSUser.login(DSUser.java:251)
        at com.visigenic.vbroker.CORBA.ORB.contactLocator(ORB.java:451)
        at com.visigenic.vbroker.CORBA.ORB.locator(ORB.java:468)
        at com.visigenic.vbroker.CORBA.ORB.iorToObject(ORB.java:1139)
        at
com.visigenic.vbroker.CORBA.GiopInputStreamImpl.read_Object(GiopInputStreamImpl.java:57)
        at
com.visigenic.vbroker.CORBA.dynamic.OrbHelperImpl.string_to_object(OrbHelperImpl.java:286)
        at
com.visigenic.vbroker.CORBA.ORB.string_to_object(ORB.java:191)
        at eg2_clt.main(eg2_clt.java:17)

Can anyone point me towards a solution?

If I can't get it to work with vbj_2.5, I'll wait for Jorba
(http://www.progsoc.uts.edu.au/~raz/jorba/) to be released and give that
a try ...

Thanks in anticipation
--
John Connett
Home: jrc@skylon.demon.co.uk
Work: jrc@art.co.uk