Archived
This forum has been archived. Please start a new discussion on GitHub.
Ice.ObjectNotExistException while using findObjectByType
Ice.ObjectNotExistException is thrown while printing the ice_id of the object proxy in the following code fragment.(This exception is thrown when any of the method from that proxy is called.) It works fine when the locator and endpoint are used to obtain the proxy instance.
Following is the code that is querying the object proxy.
Ice.ObjectPrx proxy = notifier.communicator.stringToProxy("IceGrid/Query");
IceGrid.QueryPrx query = IceGrid.QueryPrxHelper.checkedCast(proxy);
ObjectPrx objProxy = query.findObjectByType("::fca::search::agent::MatrixSearchICE");
System.out.println(objProxy.ice_id());
Please let me know what am I missing here. Let me know if you need anymore info.
Following is the stack trace.
Ice.ObjectNotExistException
id.name = "tg-dxsearch1.SearchServer"
id.category = ""
facet = ""
operation = "ice_id"
at IceInternal.Outgoing.invoke(Outgoing.java:148)
at Ice._ObjectDelM.ice_id(_ObjectDelM.java:138)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:145)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:132)
Here is the fragment from the deployment descriptor.
..........
<service name="CubeSearch" entry="cube_search:create">
<adapter name="${service}" endpoints="${endpoints}" replica-group="theCubeSearchAdapter" >
<object identity="${id}" type= "::fca::search::agent::MatrixSearchICE" />
</adapter>
.........
Following is the code that is querying the object proxy.
Ice.ObjectPrx proxy = notifier.communicator.stringToProxy("IceGrid/Query");
IceGrid.QueryPrx query = IceGrid.QueryPrxHelper.checkedCast(proxy);
ObjectPrx objProxy = query.findObjectByType("::fca::search::agent::MatrixSearchICE");
System.out.println(objProxy.ice_id());
Please let me know what am I missing here. Let me know if you need anymore info.
Following is the stack trace.
Ice.ObjectNotExistException
id.name = "tg-dxsearch1.SearchServer"
id.category = ""
facet = ""
operation = "ice_id"
at IceInternal.Outgoing.invoke(Outgoing.java:148)
at Ice._ObjectDelM.ice_id(_ObjectDelM.java:138)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:145)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:132)
Here is the fragment from the deployment descriptor.
..........
<service name="CubeSearch" entry="cube_search:create">
<adapter name="${service}" endpoints="${endpoints}" replica-group="theCubeSearchAdapter" >
<object identity="${id}" type= "::fca::search::agent::MatrixSearchICE" />
</adapter>
.........
0
Comments
-
Is the object registered on the correct object adapter? If you turn on network tracing (or protocol tracing) does the invocation go to an appropriate server and endpoint?0
-
Enabled network as well as protocol trace.
I enabled the network as well as protocol trace. I wrote two sample clients to obtain the object proxy. One is using findObjectByType and the other is the usual way of getting it. I am using the same communicator instance for both.
Thank you for your patience to scroll down the trace.
Using findObjectByType (Exception is thrown)
....
Ice.ObjectPrx proxy = communicator.stringToProxy("IceGrid/Query");
IceGrid.QueryPrx query = IceGrid.QueryPrxHelper.checkedCast(proxy);
ObjectPrx objProxy = query.findObjectByType("::fca::search::agent::MatrixSearchAgentICE");
System.out.println(objProxy.ice_id());
Trace for the above code. (Exception is thrown.)
[ Network: trying to establish tcp connection to 10.160.36.44:12000 ]
[ Network: tcp connection established
local address = 140.244.107.18:1726
remote address = 10.160.36.44:12000 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 72
request id = 1
identity = IceGrid/Locator
facet =
operation = findObjectById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 73
request id = 1
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 10.160.36.44:12000 ]
[ Network: tcp connection established
local address = 140.244.107.18:1733
remote address = 10.160.36.44:12000 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 66
request id = 1
identity = IceGrid/Query
facet =
operation = ice_isA
mode = 1 (nonmutating)
context = ]
[ 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) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 101
request id = 2
identity = IceGrid/Query
facet =
operation = findObjectByType
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 104
request id = 2
reply status = 0 (ok) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 107
request id = 2
identity = IceGrid/Locator
facet =
operation = findAdapterById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 78
request id = 2
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 10.160.36.28:11001 ]
[ Network: tcp connection established
local address = 140.244.107.18:1735
remote address = 10.160.36.28:11001 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 61
request id = 1
identity = tg-dxsearch1.SearchServer
facet =
operation = ice_id
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 54
request id = 1
reply status = 2 (object not exist)
identity = tg-dxsearch1.SearchServer
facet =
operation = ice_id ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 61
request id = 2
identity = tg-dxsearch1.SearchServer
facet =
operation = ice_id
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 54
request id = 2
reply status = 2 (object not exist)
identity = tg-dxsearch1.SearchServer
facet =
operation = ice_id ]
Ice.ObjectNotExistException
id.name = "tg-dxsearch1.SearchServer"
id.category = ""
facet = ""
operation = "ice_id"
at IceInternal.Outgoing.invoke(Outgoing.java:148)
at Ice._ObjectDelM.ice_id(_ObjectDelM.java:138)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:145)
at Ice.ObjectPrxHelperBase.ice_id(ObjectPrxHelperBase.java:132)
Usual way of obtaining the object proxy (Works fine.)
ObjectPrx objProxy = communicator.stringToProxy("CubeSearch@theCubeSearchAdapter");
System.out.println("***** ID : " +objProxy.ice_id() + "******");
[ Network: trying to establish tcp connection to 10.160.36.44:12000 ]
[ Network: tcp connection established
local address = 140.244.107.18:1766
remote address = 10.160.36.44:12000 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 72
request id = 1
identity = IceGrid/Locator
facet =
operation = findObjectById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 73
request id = 1
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 10.160.36.44:12000 ]
[ Network: tcp connection established
local address = 140.244.107.18:1771
remote address = 10.160.36.44:12000 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 66
request id = 1
identity = IceGrid/Query
facet =
operation = ice_isA
mode = 1 (nonmutating)
context = ]
[ 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) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 80
request id = 2
identity = IceGrid/Locator
facet =
operation = findAdapterById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 78
request id = 2
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 10.160.36.28:11001 ]
[ Network: tcp connection established
local address = 140.244.107.18:1772
remote address = 10.160.36.28:11001 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 46
request id = 1
identity = CubeSearch
facet =
operation = ice_id
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 68
request id = 1
reply status = 0 (ok) ]
***** ID : ::fca::search::agent::MatrixSearchAgentICE******0 -
Hi,
As indicated in the Ice.ObjectNotExistException, the identity of the proxy returned by findObjectByType is "tg-dxsearch1.SearchServer".
This identity is different from the identity that you're using in your stringToProxy call: "CubeSearch@theCubeSearchAdapter", here, the identity is "CubeSearch".
So, I assume the first identity is incorrect since it works when you create the proxy with the communicator. Shouldn't you set the identity in the object descriptor to "CubeSearch" instead of "${id}"?
That is:<object identity="CubeSearch" type= "::fca::search::agent::MatrixSearchICE" />
The identity here should be set to the same value as the one used in the server to register the object with the object adapter.
Let us know if this doesn't solve your problem!
Cheers,
Benoit.0