Home Help Center

Strange Behaviour

Hello.

I'm using Ice for my final thesis and although generally Ice is great I'm getting strange behaviour in one case, which I don't understand.
Perhaps someone can help me.

The example Code(Changed to be easier readable):

XPtr obj = ...
Ice::Identity id = ...UUID...
XPrx proxy = XPrx::uncheckedCast(objectAdapter()->add(obj, id));
proxy->ice_ping();

The output of the IceLogger is as follows:

IceLogger : Retry : re-trying operation call because of exception
Direct.cpp:69: Ice::ObjectNotExistException:
object does not exist
identity: B82A5593-4774-4110-96DC-95DD60817790
facet:
operation: ice_ping

IceLogger : Retry : cannot retry operation call because retry limit has been exceeded
Direct.cpp:69: Ice::ObjectNotExistException:
object does not exist
identity: B82A5593-4774-4110-96DC-95DD60817790
facet:
operation: ice_ping

I don't understand how I can get an ObjectNotExistException, as I just registered the object with the OA.

Thanx in advance for any help.

Gerald

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    This should not happen. Can you show me the complete code?
  • galbegalbe Member
    Code

    Hi

    thanx for the answer.

    Of course I could do that, but the project involves already quite a lot of code.
    And almost all of my classes are still "under construction" i.e. not fully evolved and with less comments than you would want... :(

    Actually I had hoped, that this kind of behaviour was known to happen under certain cirumstances.

    If you really want the code, I could either email you my working version as a tarball or email you only the relevant parts of my program.

    thanx in davance

    Gerald
  • galbegalbe Member
    the buggy method

    This is the method, that is not working.

    Hopefully this will help, clarify the situation.


    Gerald
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    The exception is caused by the client's use of generateUUID in order to form an Identity. By definition, a UUID generated by the client cannot match any UUID generated by the server for the target servant. When the request arrives at the server, the object adapter finds no servant registered for the Identity provided by the client, and then raises ObjectNotExistException.

    The correct way to do this is to obtain a proxy for the servant, either through a configuration property or by some other mechanism (such as IcePack), and then downcast to the appropriate interface. You can find lots of examples of this in the Ice demos.

    Take care,
    - Mark
  • galbegalbe Member
    Thanx

    Thank you.

    Normally, if I'm creating Servants with UUIDs, I'm taking care, to reference them with the proxy and that works fine. I'm saving the generated ID for later use, i.e removal of a servant etc.
    What I'm implementing here is a kind of Interceptor-Pattern and I'm using Ice::Identity objects to reference my interceptors.
    Therefore I have to distiguish between IDs referencing Servants in the OAs Active Servant Map and IDs referencing Interceptors in my own Interceptor Map.

    At the moment I'm quite sure, that the error resulted from an accidentally passed NullPointer.
    As a result, the method "registerInterceptor" trys to register the "NULL" InterceptorPtr with the OA.

    What surprises me here, is that the OA doesn't complain, but instead just registers a "NULL" Servant, which occupies a place in the Active Servant Map. I would have expected an Exception to be thrown, which led me to suspect other reasons for the error.

    Anyway, thanx very much for your help and further comments are quite welcome.

    Gerald
Sign In or Register to comment.