[omniORB] Java, Python, CORBA

Jakub Moskal jmoskal at ece.neu.edu
Wed Feb 11 00:11:12 GMT 2009


Hey all,

I wrote a server in Java and clients in Java and Python. Clients
connect and invoke methods without any problem when the object
reference is retrieved from a string. When I use 'orbd' and
NameService only the Java client connects, the python clients fails
with "omniORB.TRANSIENT_ConnectFailed". I init the ORB in python with
parameters "  ["-ORBInitRef", "NameService=corbaname::localhost:900"]
". What is the port on which 'orbd' runs its NameService? I tried some
other ports but all gave me the same error.

My second question has to do with creating new objects. I wrote an
object factory on client that returns new objects which implement my
interfaces, e.g.
interface MyInter {
 attribute string attr;
string printMe();
};

interface MyInterFactory {
 MyInter createMyInter(in string attr);
}

I implemented the factory in this way:
public MyInter createMyInter(string attr) {
 MyInterImpl mii = new MyInterImpl(attr);
return new MyInterPOATie(mii)._this(this.orb);
}

where this.orb is orb that is passed by the server after the init was invoked.

Now on my client, after retrieving the MyInterFactory object, I do:

MyInter mi = factory.createMyInter(attr);  //passes
String toPrint = mi.printMe();

The second line above throws a CORBA.BAD_OPERATION and after some
debugging I noticed that somehow the invocation of "printMe()" is
passed to the factory object on the server and not on the appropriate
MyInter object - whcih explains the BAD_OPERATION. Finally, my
question is how should the factory create a new object so that clients
can access them and invoke their methods. Secondly, is there a better
way for the client to be able to create new objects that implement
CORBA interfaces?

Any help greatly appreciated!
Jakub



More information about the omniORB-list mailing list