// Obtaining the reference
org.omg.CORBA.Object ref = myPOA.servant_to_reference(managerServant);
// Now write out the IOR
try {
java.io.PrintWriter pw =
new java.io.PrintWriter( new java.io.FileWriter("ior.dat") );
pw.println(orb.object_to_string(ref));
pw.close();
}
catch ( java.io.IOException e ) {
System.out.println("Error writing the IOR to file ior.dat");
return;
}
and read it later from the client ORB and then:
//Client code
//First take from a file and then....
// Destringify and narrow the object
Bank.AccountManager manager =
Bank.AccountManagerHelper.narrow(orb.string_to_object(ior_str));
When JDK ORB executes this part it sends me a message:
ERROR : org.omg.CORBA.INV_OBJREF: minor code: 1398079490 completed: No
org.omg.CORBA.INV_OBJREF: minor code: 1398079490 completed: No
at com.sun.corba.se.internal.core.CodeSetComponentInfo.read(Unknown
Sour
ce)
at com.sun.corba.se.internal.core.Profile.<init>(Unknown Source)
at com.sun.corba.se.internal.core.IOR.getProfile(Unknown Source)
at com.sun.corba.se.internal.iiop.CDRInputStream.read_Object(Unknown
Sou
rce)
at com.sun.corba.se.internal.iiop.CDRInputStream.read_Object(Unknown
Sou
rce)
at com.sun.corba.se.internal.corba.ORB.string_to_object(Unknown
Source)
But when I use the Visibroker ORB all runs OK.
How can I achieve the interoperability between this two ORBs.
It could be a problem defining the IDL or perhaps the facilities provided
from Visibroker makes imposible the interoprability?
Thaks in advance.
--
Posted from mailhost.teleline.es [195.235.113.141] (may be forged)
via Mailgate.ORG Server - http://www.Mailgate.ORG
You didn't show us how you read the IOR from the file on the
client side. It is possible that you have accidentally added
a newline to the end of the IOR. This might cause objectToString
method to fail with INVALID_OBJ_REF.
-- Steve