When debugging the code at night in China time, the following error was reported. Why?
@guchao691
I can replicate this issue when using ChannelType::RSSL_ENCRYPTED.
Exception in thread "main" java.lang.ClassCastException: com.refinitiv.ema.access.EncryptedChannelConfig cannot be cast to com.refinitiv.ema.access.SocketChannelConfig at com.refinitiv.ema.access.OmmConsumerImpl.loadDictionary(OmmConsumerImpl.java:385) at com.refinitiv.ema.access.OmmConsumerImpl.handleAdminDomains(OmmConsumerImpl.java:450) at com.refinitiv.ema.access.OmmBaseImpl.initialize(OmmBaseImpl.java:285) at com.refinitiv.ema.access.OmmConsumerImpl.<init>(OmmConsumerImpl.java:43) at com.refinitiv.ema.access.EmaFactory.createOmmConsumer(EmaFactory.java:237) at com.refinitiv.ema.examples.training.consumer.series100.ex100_MP_Streaming.Consumer.main(Consumer.java:57)
It looks like to be a problem in the API. According to the class hierarchy, EncryptedChannelConfig can't be cast to SocketChannelConfig.
You can report this issue via GitHub.
For the workaround:
1. You can load the data dictionary from the local files instead.
<Dictionary> <Name value="Dictionary_2"/> <DictionaryType value="DictionaryType::FileDictionary"/> <!-- dictionary names are optional: defaulted to RDMFieldDictionary and enumtype.def --> <RdmFieldDictionaryFileName value="./RDMFieldDictionary"/> <EnumTypeDefFileName value="./enumtype.def"/> </Dictionary>
2. Or, you can increase the value of DictionaryRequestTimeOut configuration under the Consumer.
<ConsumerList> <Consumer> <!-- Name is mandatory --> <Name value="Consumer_1"/> <DictionaryRequestTimeOut value="0"/>
Hello @guchao691
Does the problem occur when you test at other times? Does the application download Dictionary from Real-Time provider or from the local file? You can check the <DictionaryType> node in EmaConfig.xml configuration file:
Can you replicate the issue on demand? If so, please enable the XML trace, replicate the issue and share the XML trace file. You can see how to enable the XML trace in "XML Trace" section of this EMA Configuration Overview article.
wasin.waeosri
If it is not for US stock trading hours, it can be obtained normally.
Check that the configuration file is “<DictionaryType value="DictionaryType::ChannelDictionary"/>”
thanks.
If the local data dictionary is used, will there be updates in the future, and will it be necessary to synchronize updates from the server at a fixed time?
The data dictionary files are updated regularly. You can download them from Software Downloads. It is in the MDS - General product family and TREP Template Service Pack product.
Typically, you can update the data dictionary files when:
1. There are newly added fields and you want to get data from those fields.
2. Or, the application reports the following error:
value: OmmError ErrorCode="FieldIdNotFound"OmmErrorEnd
Can you provide the download address of the dictionary?
If our application uses a local dictionary, but you update the dictionary after a period of time, but our application is not updated, will there be parsing errors?
The URL is https://my.refinitiv.com/content/mytr/en/downloadcenter.html. It is in the MDS - General product family and TREP Template Service Pack product.
Typically, the data dictionary is updated when there are new fields added to the data dictionary. If your subscribed RICs use those new fields, you will see the error in the application. Then, you need to upgrade the data dictionary.
However, if your subscribed RICs don't use those new fields, there is no need to update the data dictionary.