Archived

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

IceGrid/Query

Hello,

I'm trying to find an object with the IceGrid/Query interface. I have added an object with ID "DataRecorder@DataRecorderSvcAdapter"; this works fine when I get a proxy to it via the communicator, but when I do findObjectById, I get a null proxy back. Not sure what I'm doing wrong...
IceGrid::QueryPrx qPrx =IceGrid::QueryPrx::checkedCast(basePrx);
if ( qPrx )
    printf("qPrx okay\n");
Ice::ObjectPrx found = qPrx->findObjectById(
        communicator()->
            stringToIdentity("DataRecorder@DataRecorderSvcAdapter"));

Thanks.

Comments

  • "DataRecorder@DataRecorderSvcAdapter" is an indirect proxy in string form, not an identity. The identity is simply "DataRecorder".
  • The server registers the object as "DataRecorder" on object adapter "DataRecorderSvcAdapter". I tried find... on "DataRecorder", still got back null.

    The new code snippet is:
    Ice::ObjectPrx found = qPrx->findObjectById(
            communicator()->
                stringToIdentity("DataRecorder"));
    
  • Ah, is the problem that I didn't start the server on an icegridnode?
  • mes
    mes California
    Hi,

    The findObjectById operation can only be used to find well-known objects. Have you configured IceGrid so that DataRecorder is a well-known object?

    Take care,
    - Mark