The documentation doesn't really specify why lookup_instance would throw that exception in Java (in fact, this documentation seems to indicate that it never throws anything), so I'm a little stumped.
I haven't really found an example of lookup_instance beign used either, so I'm not sure I'm doing it correctly at all.
I have a topic (we'll call it "MyTopic" with 3 keys (say, all of type int, named keyA, keyB and keyC).
My code looks something like:
MyTopicDataReader myDataReader; //Instanciate data reader somewhere over here... MyTopic keyHolder = new MyTopic(); keyHolder.keyA = 1; keyHolder.keyB = 2; keyHolder.keyC = 3; InstanceHandle_t handle = myDataReader.lookup_instance(keyHolder); if(handle == InstanceHandle_t.HANDLE_NIL) //Didn't find the instance else //instance found, call myDataReader.take_instance(...)
I get the following exception during runtime:
com.rti.dds.infrastructure.RETCODE_ILLEGAL_OPERATION
at com.rti.dds.util.Utilities.rethrow(Unknown Source)
at com.rti.dds.infrastructure.RETCODE_ERROR.check_return_codeI(Unknown Source)
at com.rti.dds.infrastructure.EntityImpl.lock_native_entityI(Unknown Source)
at com.rti.dds.infrastructure.EntityImpl.lock(Unknown Source)
at com.rti.dds.subscription.DataReaderImpl.lookup_instance_untyped(Unknown Source)
at MyTopicDataReader.lookup_instance(MyTopicDataReader.java:207)
Hi Philipe,
It looks like you also submitted a case to our support team. To close the loop on the community forum, you mentioned you refactored your code and the issue is no longer there. However, you do not know exactly what you changed to resolve the exception.
If you discover the change that resolved the issue, please add it to this post so the community can benefit from it.
Regards,
Bobby