try {
PortableRemoteObject.exportObject((java.rmi.Remote) obj);
objref = (javax.rmi.CORBA.Stub) PortableRemoteObject
.toStub((java.rmi.Remote) obj);
} catch (java.rmi.RemoteException ex) {
throw new MARSHAL("cannot convert Remote to Object");
}
}
} else {
throw new MARSHAL(
"object is neither Remote nor org.omg.CORBA.Object: "
+ obj.getClass().getName());
}
out.write_Object(objref);