Archived

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

Problem adding topic as well-known object

Hello!

I am currently updating my application by using the new features of ICE 3.2b. A problem appears when I try to add a topic as a well-known object. Specifically, I get a DeploymentException that shows me adding object <my_topic> is not allowed.

I have reviewed the Matthew's article of IceStorm 3.2, but I have not found any related topic to my problem. Note that I do not have to upgrade my IceStorm 3.1 database.

Some idea? I use ICE 3.2b, Debian GNU/Linux, and C++ for developing the publisher.

Thank you very much,
David.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    What is the exact message from the IceGrid::DeploymentException exception and how do you register the well-known object?

    Cheers,
    Benoit.
  • The exact message I obtain is extracted from the reason parameter of the DeploymentException captured:
    DeploymentException adding object `FIPA/topic.DirectoryFacilitator' is not allowed

    On the other hand, I register the well-known object programmatically:
    const string proxyProperty = "IceStorm.TopicManager.Proxy";
    string proxy = properties->getProperty(proxyProperty);
    if(proxy.empty())
    {
    cerr << "Property `" << proxyProperty << "' not set" << endl;
    return ;
    }

    Ice::ObjectPrx base = communicator->stringToProxy(proxy);
    IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base);

    if(!manager)
    {
    cerr << "Invalid proxy" << endl;
    return ;
    }

    IceStorm::TopicPrx topic;
    try
    {
    topic = manager->retrieve("DirectoryFacilitator");
    }
    catch(const IceStorm::NoSuchTopic& e)
    {
    topic = manager->create("DirectoryFacilitator");
    }

    ...

    Ice::ObjectPrx prx1 = communicator->stringToProxy("FIPA/Registry");
    IceGrid::RegistryPrx registryPrx = IceGrid::RegistryPrx::checkedCast(prx1);
    IceGrid::AdminSessionPrx adminSessionPrx;

    try
    {
    adminSessionPrx = registryPrx->createAdminSession("david", "dummy");
    }
    catch (const IceGrid::PermissionDeniedException& ex)
    {
    cout << "permission denied:\n" << ex.reason << endl;
    }

    IceGrid::AdminPrx adminPrx = adminSessionPrx->getAdmin();

    try
    {
    adminPrx->addObjectWithType(topic, topic->ice_id());
    }
    catch (const IceGrid::ObjectExistsException&)
    {
    }
    catch (const IceGrid::DeploymentException& ex)
    {
    cout << "DeploymentException:\n" << ex.reason << endl;
    }

    Note I check the topic is correctly created by using the icestormadmin command line utility.
  • benoit
    benoit Rennes, France
    You get this exception because you're using the same instance name for the IceGrid service and your IceStorm service and the registry doesn't allow the registration of objects with a category equal to its instance name. Using another instance name for IceGrid will fix the problem.

    We'll fix the exception message to be more explicit, thanks for bringing this to our attention.

    Cheers,
    Benoit.