Archived
This forum has been archived. Please start a new discussion on GitHub.
Problem with IcePack.Registry
I have setup a demo VC7.1 project for IcePack studying ( under ICE 1.5.1 release) and a problem confused me.
The demo consists of three parts: a configuration file for icepackregistry, an ICE server and an ICE client.
The content of config file for icepackregistry as below.
The content of config file for Client & Server as below:
I test my demo in 3 steps:
1. start icepackregistry
icepackregistry --Ice.Config=config
2. start Server
Server.exe --Ice.Config=config
3. start Client
Client.exe --Ice.Config=config
For first time, everything works as expected.
Then I shutdown icepackregistry and Server (by Ctrl+C) and re-test the demo as above. But client report error:
I shutdown icepackregistry and Server, remove all files (generated by icepackregistry) in folder `db' (which specified with IcePack.Registry.Data), and re-test my demo, it works!
The server side code looks like this:
Can anybody tell me why and how to fix the problem?
Thanks.
The demo consists of three parts: a configuration file for icepackregistry, an ICE server and an ICE client.
The content of config file for icepackregistry as below.
[B] IcePack.Registry.Client.Endpoints = default -p 12000 IcePack.Registry.Server.Endpoints = default IcePack.Registry.Data = db IcePack.Registry.DynamicRegistration = 1 [/B]
The content of config file for Client & Server as below:
[B] Ice.Default.Locator = IcePack/Locator:default -p 12000 #server side MyAdapter.AdapterId = RC_Adapter MyAdapter.Endpoints = default #client side MyObject = objRC@RC_Adapter [/B]
I test my demo in 3 steps:
1. start icepackregistry
icepackregistry --Ice.Config=config
2. start Server
Server.exe --Ice.Config=config
3. start Client
Client.exe --Ice.Config=config
For first time, everything works as expected.
Then I shutdown icepackregistry and Server (by Ctrl+C) and re-test the demo as above. But client report error:
[B] client: .\Reference.cpp:712: Ice::NoEndpointException: no suitable endpoint available for proxy `objRC -t @ RC_Adapter' [/B]
I shutdown icepackregistry and Server, remove all files (generated by icepackregistry) in folder `db' (which specified with IcePack.Registry.Data), and re-test my demo, it works!
The server side code looks like this:
[B] ... Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("MyAdapter"); Ice::ObjectPtr object = new RemoteCallI(); adapter->add(object, Ice::stringToIdentity("objRC")); adapter->activate(); communicator()->waitForShutdown(); ... [/B]The client side code looks like this:
[B] ... Ice::ObjectPrx base = communicator()->stringToProxy(properties->getProperty("MyObject")); if (!base){ std::cerr << "Can't create proxy!" << std::endl; return -1; } RemoteCallPrx proxy = RemoteCallPrx::checkedCast(base); if (!proxy){ std::cerr << "It's not a valid RemoteCall proxy!" << std::endl; return -1; } std::cout << proxy->getTime() << std::endl; ... [/B]
Can anybody tell me why and how to fix the problem?
Thanks.
0