Re: Does CORBA::ORBIT place any constraints on the IIOP?
- From: Anders Selander <selander pdc kth se>
 
- To: Huw Rogers <count0 building2 co jp>
 
- Cc: orbit-perl-list pdc kth se
 
- Subject: Re: Does CORBA::ORBIT place any constraints on the IIOP?
 
- Date: Tue, 16 Apr 2002 14:41:22 +0200
 
On Mon, Apr 15, 2002 at 11:39:03PM +0900, Huw Rogers wrote:
> Here's a patch for CORBA::ORBit 0.4.3 that brings it up to date with CVS
> and further adds many bug fixes and patches I've made. Use with ORBit
> stable 0.5.13 or later (not 0.5.12). Don't use ORBit2.
Many thanks for the patches, Huw. It feels kind of nice to be running 
CORBA::ORBit 0.4.4. ;-)
Which cvs would that be? Does it have anonymous access? All files wan not
updated at anonymous anoncvs3 gnome org  Anyway, I patched a 0.4.3 into
a 0.4.4 and did some testing with orbit 0.5.15-2 on a Debain Linux
machine, to little avail (see below). Does others experience the same
problem?
> Put this at the beginning of your perl script before the
> use CORBA::ORBit line:
> BEGIN { unshift @ARGV, qw(-ORBIIOPIPv4 1); }
> Now you have an interoperable Perl / CORBA binding.
That is exactly the same as having "ORBIIOPIPv4=1" in one's
.orbitrc, isn't it?
Best Regards /Selander
Anders Selander   Centre for Parallel Computers   selander pdc kth se
Programmer        Royal Institute of Technology   +46 (0)8  790 72 11
                  SE-100 44  STOCKHOLM, SWEDEN    +46 (0)70 266 29 67
Java 1.3:
> idlj -f all MyObject.idl
> javac Server.java
> java Server
> ./client.pl
Version: 0.4.4
(nothing more happens until one interrupts either the server or the 
client, same thing with Java 1.4)
Java 1.2:
> /usr/java/jdk1.2.2/bin/java Server3
> ./client.pl
Version: 0.4.4
Exception: CORBA::UNKNOWN ('IDL:omg.org/CORBA/UNKNOWN:1.0')
    (3, COMPLETED_NO)
   The unknown exception
But with Java1.2 and the server on a remote Solaris-machine:
> ./client.pl 
Version: 0.4.4
Answer is 72.
It is so utterly annoying!
Files:
MyObject.idl
------------
module my_module {
        interface MyObject {
                long name();
        };
};
client.pl
---------
#!/usr/bin/perl -w
BEGIN { unshift @ARGV, qw(-ORBIIOPIPv4 1); }
use strict;
use CORBA::ORBit;
my ($orb, $object, $ior); 
$orb = CORBA::ORB_init("orbit-local-orb");
$orb->load_idl_file("MyObject.idl");
open IOR, "ns.ref" or die "open failed: $!";
$ior = <IOR>;
close IOR;
chomp $ior;
$object = $orb->string_to_object($ior);
print "Version: ",  $CORBA::ORBit::VERSION, "\n";
print "Answer is ", $object->name, ".\n";
Server.java
-----------
import my_module.*;
import org.omg.CORBA.*;
import java.io.*;
public class Server
{
  public static void main(String args[])
  {
    try{
      ORB orb = ORB.init(args, null);
      MyObject myRef = new MyObject();
      orb.connect(myRef);
      String ior = orb.object_to_string(myRef);
      try {
          FileOutputStream fos = new FileOutputStream("ns.ref");
          PrintStream ps = new PrintStream (fos);
          ps.print (ior);
          ps.close ();
      } catch (Exception ex) {
          ex.printStackTrace();
          System.exit(0);
      }
      java.lang.Object sync = new java.lang.Object();
      synchronized(sync){
        sync.wait();
      }
    } catch(Exception e) {
        System.err.println("ERROR: " + e);
        e.printStackTrace(System.out);
      }
  }
}
class MyObject extends _MyObjectImplBase
{
  public int name()
  {
    return 72;
  }
}
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]