Archived
This forum has been archived. Please start a new discussion on GitHub.
Ice::Plugin && Ice::LoggerPlugin
hi, I try to make a plugin for send the logs messages to an icestorm service
but when i try to do the checkedCast I receive an exception ( icestorm service is up because is used from other client)
the exception is that:
Ice::Excetpion : Reference.cpp:1585: Ice::NoEndpointException:
no suitable endpoint available for proxy `MyStorm/TopicManager -t @ StormAdapter'
but when i try to do the checkedCast I receive an exception ( icestorm service is up because is used from other client)
the exception is that:
Ice::Excetpion : Reference.cpp:1585: Ice::NoEndpointException:
no suitable endpoint available for proxy `MyStorm/TopicManager -t @ StormAdapter'
void IceLoggerPlugin::initialize() { ... try { IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(m_com->stringToProxy(props->getProperty("Log.topicManagerPrx") )); } catch(Ice::Excetpion& ex ) { cout << " Ice::Excetpion : "<< ex.what() << endl; } }
0
Comments
-
Hi Andrew,
Your plugin is attempting to use an indirect proxy, which requires that the communicator be configured with a locator. However, Ice does not configure the communicator's default locator until after the plugins are initialized. This is necessary because the locator's proxy might use endpoints that depend on a transport plugin.
You should be able to work around this by manually configuring your proxy with a locator. For example:Ice::ObjectPrx obj = m_com->stringToProxy(props->getProperty("Ice.Default.Locator")); Ice::LocatorPrx locator = Ice::LocatorPrx::checkedCast(obj); obj = m_com->stringToProxy(props->getProperty("Log.topicManagerPrx")); obj = obj->ice_locator(locator); IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(obj);
Also note that if your logger uses SSL, you must ensure that the IceSSL plugin is loaded before your logger plugin.
Hope that helps,
Mark0