|
|
|
|||||
|
The following code:
std::string registryProxyStr = "IceGrid/Registry:tcp -p 4061"; IceGrid::RegistryPrx registry = IceGrid::RegistryPrx::checkedCast( communicator->stringToProxy(registryProxyStr)); try { IceGrid::AdminSessionPrx session = registry->createAdminSession( user, password); session->keepAlive(); } catch (Ice::Exception const & e) { // print out exception throw; } produces an ObjectNotExist exception when invoking keepAlive on the session proxy: object does not exist: identity: `IceGrid/d542d531-7e39-4102-9d5f-23914df22e6c' facet: operation: keepAlive I don't understand why the proxy just given to me by the registry would not point to an existing object. I run the registry on the same box as the program. The IceGrid Admin GUI shows the registry dynamic well known object: IceGrid/Registry -t:tcp -h 10.20.5.167 -p 4061. registry->ice_toString() gives "IceGrid/Registry -t:tcp -h 127.0.0.1 -p 4061". session->ice_toString() gives "IceGrid/d542d531-7e39-4102-9d5f-23914df22e6c -t:tcp -h 10.20.5.167 -p 4061" Any help is appreciated. |
|
|||||
|
Thanks. The proxy strings are in the original post. Yes, of course you are right - the endpoints turn out to be different, although they both (127.0.0.1:4061 and 10.20.5.167:4061) refer to the same host. Here is the log:
[ 03/03/08 12:43:22.615 Network: attempting to bind to tcp socket 127.0.0.1:0 ] [ 03/03/08 12:43:22.630 Network: accepting tcp connections at 127.0.0.1:3108 ] [ 03/03/08 12:43:23.443 Network: attempting to bind to tcp socket 10.20.5.167:0 ] [ 03/03/08 12:43:23.443 Network: accepting tcp connections at 10.20.5.167:3111 ] [ 03/03/08 12:43:23.458 Network: attempting to bind to tcp socket 127.0.0.1:0 ] [ 03/03/08 12:43:23.458 Network: accepting tcp connections at 127.0.0.1:3114 ] [ 03/03/08 12:43:23.458 Network: trying to establish tcp connection to 127.0.0.1:4061 ] [ 03/03/08 12:43:23.458 Network: tcp connection established local address = 127.0.0.1:3115 remote address = 127.0.0.1:4061 ] [ 03/03/08 12:43:23.458 Protocol: received validate connection message type = 3 (validate connection) compression status = 0 (not compressed; do not compress response, if any) message size = 14 ] [ 03/03/08 12:43:23.458 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 74 request id = 1 identity = IceGrid/Registry facet = operation = ice_isA mode = 1 (nonmutating) context = ] [ 03/03/08 12:43:23.458 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 26 request id = 1 reply status = 0 (ok) ] [ 03/03/08 12:43:24.130 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 64 request id = 2 identity = IceGrid/Registry facet = operation = getSessionTimeout mode = 1 (nonmutating) context = ] [ 03/03/08 12:43:24.130 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 29 request id = 2 reply status = 0 (ok) ] [ 03/03/08 12:43:24.740 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 79 request id = 3 identity = IceGrid/Registry facet = operation = createAdminSession mode = 0 (normal) context = ] [ 03/03/08 12:43:24.740 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 105 request id = 3 reply status = 0 (ok) ] [ 03/03/08 12:43:25.146 Network: trying to establish tcp connection to 10.20.5.167:4061 ] [ 03/03/08 12:43:25.146 Network: tcp connection established local address = 10.20.5.167:3118 remote address = 10.20.5.167:4061 ] [ 03/03/08 12:43:25.146 Protocol: received validate connection message type = 3 (validate connection) compression status = 0 (not compressed; do not compress response, if any) message size = 14 ] [ 03/03/08 12:43:25.552 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 84 request id = 1 identity = IceGrid/d198bfed-ca7f-4031-9ee4-394b1ce3059f facet = operation = keepAlive mode = 2 (idempotent) context = ] [ 03/03/08 12:43:25.552 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 77 request id = 1 reply status = 2 (object not exist) identity = IceGrid/d198bfed-ca7f-4031-9ee4-394b1ce3059f facet = operation = keepAlive ] [ 03/03/08 12:43:26.630 Network: stopping to accept tcp connections at 10.20.5.167:3111 ] [ 03/03/08 12:43:26.630 Network: stopping to accept tcp connections at 127.0.0.1:3114 ] [ 03/03/08 12:43:26.630 Protocol: sending close connection message type = 4 (close connection) compression status = 1 (not compressed; compress response, if any) message size = 14 ] [ 03/03/08 12:43:26.630 Protocol: sending close connection message type = 4 (close connection) compression status = 1 (not compressed; compress response, if any) message size = 14 ] [ 03/03/08 12:43:26.630 Network: shutting down tcp connection for writing local address = 127.0.0.1:3115 remote address = 127.0.0.1:4061 ] [ 03/03/08 12:43:26.630 Network: closing tcp connection local address = 127.0.0.1:3115 remote address = 127.0.0.1:4061 ] [ 03/03/08 12:43:26.630 Network: shutting down tcp connection for writing local address = 10.20.5.167:3118 remote address = 10.20.5.167:4061 ] [ 03/03/08 12:43:26.630 Network: closing tcp connection local address = 10.20.5.167:3118 remote address = 10.20.5.167:4061 ] 03/03/08 12:43:27.521 error: ServiceManager: exception while starting service ServerMonitor: Outgoing.cpp:388: Ice::ObjectNotExistException: object does not exist: identity: `IceGrid/d198bfed-ca7f-4031-9ee4-394b1ce3059f' facet: operation: keepAlive [ 03/03/08 12:43:27.521 Network: stopping to accept tcp connections at 127.0.0.1:3108 ] Here is what I've done to go around this problem: IceGrid::AdminSessionPrx session = registry->createAdminSession(user, password); Ice::ConnectionPtr conn = registry->ice_getConnection(); Ice::ObjectPrx prx = conn->createProxy(session->ice_getIdentity()); session = IceGrid::AdminSessionPrx::uncheckedCast(prx); // session->ice_toString()); session->keepAlive(); Is this right? It seems to work. For some reason "session->ice_toString()" throws a FixedProxyException Thanks |
|
|||||
|
Thanks. The proxy strings are in the original post. Yes, of course you are right - the endpoints turn out to be different, although they both (127.0.0.1:4061 and 10.20.5.167:4061) refer to the same host. Here is the log:
[ 03/03/08 12:43:22.615 Network: attempting to bind to tcp socket 127.0.0.1:0 ] [ 03/03/08 12:43:22.630 Network: accepting tcp connections at 127.0.0.1:3108 ] [ 03/03/08 12:43:23.443 Network: attempting to bind to tcp socket 10.20.5.167:0 ] [ 03/03/08 12:43:23.443 Network: accepting tcp connections at 10.20.5.167:3111 ] [ 03/03/08 12:43:23.458 Network: attempting to bind to tcp socket 127.0.0.1:0 ] [ 03/03/08 12:43:23.458 Network: accepting tcp connections at 127.0.0.1:3114 ] [ 03/03/08 12:43:23.458 Network: trying to establish tcp connection to 127.0.0.1:4061 ] [ 03/03/08 12:43:23.458 Network: tcp connection established local address = 127.0.0.1:3115 remote address = 127.0.0.1:4061 ] [ 03/03/08 12:43:23.458 Protocol: received validate connection message type = 3 (validate connection) compression status = 0 (not compressed; do not compress response, if any) message size = 14 ] [ 03/03/08 12:43:23.458 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 74 request id = 1 identity = IceGrid/Registry facet = operation = ice_isA mode = 1 (nonmutating) context = ] [ 03/03/08 12:43:23.458 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 26 request id = 1 reply status = 0 (ok) ] [ 03/03/08 12:43:24.130 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 64 request id = 2 identity = IceGrid/Registry facet = operation = getSessionTimeout mode = 1 (nonmutating) context = ] [ 03/03/08 12:43:24.130 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 29 request id = 2 reply status = 0 (ok) ] [ 03/03/08 12:43:24.740 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 79 request id = 3 identity = IceGrid/Registry facet = operation = createAdminSession mode = 0 (normal) context = ] [ 03/03/08 12:43:24.740 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 105 request id = 3 reply status = 0 (ok) ] [ 03/03/08 12:43:25.146 Network: trying to establish tcp connection to 10.20.5.167:4061 ] [ 03/03/08 12:43:25.146 Network: tcp connection established local address = 10.20.5.167:3118 remote address = 10.20.5.167:4061 ] [ 03/03/08 12:43:25.146 Protocol: received validate connection message type = 3 (validate connection) compression status = 0 (not compressed; do not compress response, if any) message size = 14 ] [ 03/03/08 12:43:25.552 Protocol: sending request message type = 0 (request) compression status = 0 (not compressed; do not compress response, if any) message size = 84 request id = 1 identity = IceGrid/d198bfed-ca7f-4031-9ee4-394b1ce3059f facet = operation = keepAlive mode = 2 (idempotent) context = ] [ 03/03/08 12:43:25.552 Protocol: received reply message type = 2 (reply) compression status = 0 (not compressed; do not compress response, if any) message size = 77 request id = 1 reply status = 2 (object not exist) identity = IceGrid/d198bfed-ca7f-4031-9ee4-394b1ce3059f facet = operation = keepAlive ] Here is what I've done to go around this problem: IceGrid::AdminSessionPrx session = registry->createAdminSession(user, password); Ice::ConnectionPtr conn = registry->ice_getConnection(); Ice::ObjectPrx prx = conn->createProxy(session->ice_getIdentity()); session = IceGrid::AdminSessionPrx::uncheckedCast(prx); // session->ice_toString()); session->keepAlive(); Is this right? It seems to work. For some reason "session->ice_toString()" throws a FixedProxyException Thanks |
|
||||||
|
While this works, you would have to do this for each proxy returned by the admin session (the proxy of the admin object, etc). Instead, I would recommend to use the well-known proxy to create the IceGrid::Registry proxy and configure the Ice.Default.Locator property (Ice.Default.Locator="IceGrid/Locator:tcp -p 4061"), for example:
Code:
// C++
Ice::ObjectPrx obj = communicator->stringToProxy("IceGrid/Registry");
IceGrid::RegistryPrx registry = IceGrid::RegistryPrx::checkedCast(obj);
try
{
IceGrid::AdminSessionPrx session = registry->createAdminSession(user, password);
session->keepAlive();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
throw;
}
Cheers, Benoit. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with IcePatch2 and IceGrid | piontec | Help Center | 3 | 01-07-2008 08:29 AM |
| a problem of session-timeout on mobile phone | neons | Help Center | 1 | 11-14-2007 09:42 AM |
| Upgrade to ice 3.2 : problem with Icegrid admin session | Vivien Delage | Help Center | 2 | 10-15-2007 05:13 AM |
| Problem keeping IceGrid::Admin session alive | borax00 | Help Center | 2 | 05-03-2007 04:55 AM |
| problem with IceGrid example | bdk | Help Center | 3 | 09-29-2006 05:28 AM |