question

Upvotes
Accepted
3 0 2 4

Exception occurred: com.sun.jdi.InvocationException occurred invoking method..

While debugging, the value of any OmmArray is:

ErrorException occurred: com.sun.jdi.InvocationException occurred invoking method..

Usually, not defining toString() method causes this error in the debug mode. However, the toString() method is defined in OmmArrayImpl that implements OmmArray, and is used by EmaFactory to return a new OmmArray. A bug is blocking me and I can't find it due to this reason.

Any help? Thanks

Edit: additional info:

EMA 3.2.2.0, Java 1.8 with Maven, Windows 10

The problem occurs while creating dynamic OmmConsumers, here is a small piece of code that briefs the code I have:

fields_array.add(EmaFactory.createOmmArrayEntry().intValue(13));
fields_array.add(EmaFactory.createOmmArrayEntry().intValue(14));
batch_array.add(EmaFactory.createOmmArrayEntry().ascii("EUR="));
batch_array.add(EmaFactory.createOmmArrayEntry().ascii("GBP="));

ElementList customView = EmaFactory.createElementList();
customView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, batch_array));
customView.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
customView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, field_array));

consumer.registerClient(EmaFactory.createReqMsg().serviceName(serviceName).payload(customView), new AppClient());
}

The code above might work, however, my actual code is more complex but avoided posting it because it's long and might be not important for the question. Please don't hesitate to ask for it if necessary.

Since running the code I have results in an error, I'm using debug mode to investigate and find the bug. It is something related to the fields_array and the only way to solve it is to check it's value during debug mode. And that is not possible due the above error.

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apiOMM
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hello @samer.masaad,

In order for us to be able to help, try to provide as much information as possible:

  • Version of EMA, Java, OS
  • What was the application doing when this exception has occurred
  • Does it occur repeatedly, or what is the way to reproduce
  • Did the app ever function as expected, is this something that has first appeared after changes, if so, what were the changes to the app?
  • Attach the code, the complete trace, any other pertaining info that is relevant to the question

We will try to help.

Thank you for your answer. I have updated the question with the additional info.

Upvotes
Accepted
23k 22 9 14

Hello @samer.masaad,

If you feel this is an issue with Elektron SDK, please post the complete description, as an issue with Elektron SDK on GitHub.

If you feel this is an issue with a debugger, you may get a better result by reporting it to the provider of the debugger tool?

If you feel the issue has been resolved, please let us know.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
9.7k 49 38 60

Hi @samer.masaad,

It is obviously difficult to debug your application with code that might work if we were to try it. That being said, if you are able to narrow down the issue with a small snippet that you know fails consistently, that could help.

I don't know the level of debugging you have tried, but the EMA Java source code is included along with the download package and you can step through code segments such as OmmArrayImpl to better understand - you may already be doing this. However, you do say you are unable to debug your fields_array, which I don't fully understand why not.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @samer.masaad,

I have taken an example BatchView MarketPrice consumer, and replaced the main part, the guts of it, with your code. It works. (I can attach the code, if on interest)

Therefore, you should assume that the issue you are seeing originates in another part of the code. I am totally in agreement with @nick.zincone.1 , will need to narrow down the possible location, in order to pinpoint and fix.

Hope this info is of help, by excluding some possibilities.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 0 2 4

Hello @zoya.farberov and @nick.zincone.1,

Thank you for your kind replies. The main reason of my question was never to fix the actual bug I have in my code, but to fix the problem I faced with the debugger, that's why I avoided posting my code. However, I was able to solve the bug using some turnarounds, but the debugger still shows the same error anytime I try to access any OmmArray in anywhere in my program, even when the code works. The debugger problem is not specific to this chunk of code.

Even though my bug is solved, I'm still open to discuss the solution of this problem hoping to help anyone that might encounter the problem later.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea