Archived

This forum has been archived. Please start a new discussion on GitHub.

Problem with "addWithUUID", while implementing the facets

Hi all,

1). I am facing a problem in adding a servant object to ObjectAdapterPtr using addWithUUID. The servant object is not getting added to the adapter, so client is "Aborting" when it triews to down cast to PrinterPrx using "checkedCast". The following code snippet is in my client.cpp file

Ice::ObjectPrx base = ic->stringToProxy("SimplePrinter:tcp -h 192.168.147.202 -p 10000");
PrinterPrx printer = PrinterPrx::checkedCast(base);

2). If I am using ObjectAdapterPtr's "add()" method instead of "addWithUUID() ". The servant object is getting added successfully and "client" is able to connect to the server without any changes in the code. With the following code snippet I tried to add my servant object to the ObjectAdapterPtr.

Ice::ObjectAdapterPtr adapter
= ic->createObjectAdapterWithEndpoints(
"SimplePrinterAdapter","tcp -h 192.168.147.202 -p 10000");
PrinterPtr printer = new PrinterI();
// adapter->add(printer,Ice::stringToIdentity("SimplePrinter"));
Ice::ObjectPrx printprx = adapter->addWithUUID(printer);

Here I have commented the line which uses "add()" method. If I release that line then it is getting added and client is also working fine.

3). The following exception is caught when I try to run the client, when the server is using "addWithUUID()".

[root@mailserver facets]# ./client
Outgoing.cpp:359: Ice::ObjectNotExistException:
object does not exist
identity: SimplePrinter
facet:
operation: ice_isA

4). In the Ice manual document, in the "32 .Facets and Versioning " chapter it is mentioned that, if we want to add any additional facet, then we have to use addWithUUID to get the "Identity" of default facet. And we need to use this "Identity" when we are adding additional facets. But I am facing problem while using "addWithUUID()" to add servant object.

Is it the only way to implement facet functionality?

Please help me how to resolve this issue. I am attaching the files I am using in my application. Can any one provide me with any example which implements facets.

Thanks & Regards
Phani Kommula

Comments

  • marc
    marc Florida
    Welcome to our forums! Please see this post regarding our support policy here on these forums.