When debugging the code at night in China time, the following error was reported. Why?
When debugging the code at night in China time, the following error was reported. Why?
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"/>
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?
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.
hello @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"/>”