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 22.214.171.124, 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.
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.
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.
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.
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.