Archived

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

IceStorm Publishing Error

Im getting the following error when I attempt to publish to IceStorm:
[ IceStorm: Topic: Subscribe: 0f84d13a-a850-45d8-8c5a-afe9b7a54b7d ]
[ IceStorm: Subscriber: 0f84d13a-a850-45d8-8c5a-afe9b7a54b7d: publish failed: .\LocatorInfo.cpp:337: Ice::NotRegisteredException:
   no object with id `0f84d13a-a850-45d8-8c5a-afe9b7a54b7d' is registered ]
Here is the code I am using on the publisher:
Ice::ObjectPrx obj = Ice::Application::communicator()->stringToProxy("IceStorm/TopicManager");
IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(obj);
IceStorm::TopicPrx topic;

try
{
	topic = topicManager->retrieve("Location");
}

catch (const IceStorm::NoSuchTopic&)
{
	cout << "No such topic" << endl;
	//topic = topicManager->create("Weather");
}

Ice::ObjectPrx pub = topic->getPublisher();
if (!pub)
{
	cout << "pub failed" << endl;
}
	
//if (!pub->ice_isDatagram()) 
	pub = pub->ice_oneway();
	
Demo::StormPrx monitor = Demo::StormPrx::uncheckedCast(pub);

monitor->tick();
And on the subscriber:
IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator->stringToProxy("IcePack/Query"));
Ice::ObjectPrx obj = query->findObjectByType("::IceStorm::TopicManager");
IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(obj);
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("MonitorAdapter");
StormPtr monitor = new StormI;
Ice::ObjectPrx proxy = adapter->addWithUUID(monitor);
adapter->activate();
	
IceStorm::TopicPrx topic;

try
{
	topic = topicManager->retrieve("Location");
	IceStorm::QoS qos;
	topic->subscribe(qos, proxy);
}

catch (const IceStorm::NoSuchTopic&)
{
	// Error! No topic found!
	cout << "No such topic!" << endl;
	cout << "Creating..." << endl;
	topic = topicManager->create("Location");
	IceStorm::QoS qos;
	topic->subscribe(qos, proxy);
}
I am loading IceStorm with IceBox through IcePack behind a Glacier2 router. Here is the descriptor:
<server name="IceStorm" kind="cpp-icebox" endpoints="tcp -h 127.0.0.1 -p 10000" activation="on-demand">
  <service name="IceStorm" entry="IceStormService,21:create">
  <dbenv name="${service}" /> 
    <adapters>
      <adapter name="${service}.TopicManager" endpoints="tcp">
        <object identity="${service}/TopicManager" type="::IceStorm::TopicManager" /> 
      </adapter>
      <adapter name="${service}.Publish" endpoints="tcp" /> 
   </adapters>
   <properties>
     <property name="IceStorm.Trace.Subscriber" value="1" /> 
     <property name="IceStorm.Trace.TopicManager" value="2" /> 
     <property name="IceStorm.Trace.Topic" value="1" /> 
   </properties>
  </service>
</server>


Any suggestions?

Comments

  • benoit
    benoit Rennes, France
    The exception "Ice::NotRegisteredException: no object with id `0f84d13a-a850-45d8-8c5a-afe9b7a54b7d' is registered" indicates that the proxy for your subscriber doesn't have any endpoints or doesn't refer to any adapter id.

    What is the configuration of your subscriber? Is the subscriber connected to IceStorm through Glacier2? If that's the case I assume you also want the communications from the IceStorm service to your client to go through the Glacier2 service. You need to configure your subscriber object adapter to use the Glacier2 router. Proxies created with this object adapter will contain the endpoints to route the request through the Glacier2 service.

    I recommend you to take a look at the implementation of the Chat demo included with the Ice newsletter. In the issue 6 for example we demonstrate a very similar deployment. The configuration of the Chat client and your subscriber should be very similar.

    Benoit.
  • Thanks for your help Benoit, but I am unsure of how to configure the obeject adaptor to use Glacier2, but at least I have the subscribing working.

    I changed the adaptor name to Test.Subscriber and added Test.Subscriber.Endpoints=tcp to the config file.

    How could I change this to use glacier2?
  • matthew
    matthew NL, Canada
    I wrote extensively about Glacier 2 in the first two issues of Connections. I suggest you read my two articles, and then if you have further questions ask away.