question

Upvotes
Accepted
1 1 0 2

NullPointerException from UpdateMsgImpl.toString

When we are trying to subscribe for instruments (EUR=TRB, EUR=, AUD=TRB, etc) the first RefreshMessage is fine, but next UpdateMessages always throw NullPointerException from toString() method or during payload parsing.

  • How we can find out whats wrong
  • Could you provide documentation, how to configure logging for error or warning messages from Reuters Ema API.

Example of the valid RefreshMsg from log file:

[2018-07-02 10:37:42.310] [INFO ] [hz.client_0.event-5] - r.s.f.r.i.DefaultReutersApiConnector.() - ***REUTERS. Subscription stream is opened for symbol AUD/USD and Reuters item AUD=TRB

[2018-07-02 10:37:42.348] [DEBUG] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Refresh msg: RefreshMsg

streamId="12"

domain="MarketPrice Domain"

solicited

RefreshComplete

state="Open / Ok / None / 'All is well'"

itemGroup="00 01"

permissionData="03 01 01 54 90 c0"

name="AUD=TRB"

nameType="1"

serviceId="257"

serviceName="IDN_SELECTFEED"

Payload dataType="FieldList"

FieldList FieldListNum="0" DictionaryId="1"

FieldEntry fid="22" name="BID" dataType="Real" value="0.73705"

FieldEntry fid="25" name="ASK" dataType="Real" value="0.73715"

FieldEntry fid="3386" name="QUOTE_DATE" dataType="Date" value="02 JUL 2018"

FieldEntry fid="3754" name="SCALING" dataType="Rmtes" value=" 1"

FieldEntry fid="3791" name="START_DT" dataType="Date" value="05 JUL 2018"

FieldEntry fid="3855" name="QUOTIM_MS" dataType="UInt" value="27461021"

FieldListEnd

PayloadEnd

RefreshMsgEnd

Example of the failed UpdateMsg from logs:

[2018-07-02 10:37:42.693] [DEBUG] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: [!!!com.thomsonreuters.ema.access.UpdateMsgImpl@46fc4f6f=>java.lang.NullPointerException:null!!!]

[2018-07-02 10:37:42.693] [WARN ] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding

java.lang.NullPointerException: null

Xml and EmaFactory configurations:

this.view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
array.add(EmaFactory.createOmmArrayEntry().intValue(BID_ID)); // 22
array.add(EmaFactory.createOmmArrayEntry().intValue(ASK_ID)); //25
array.add(EmaFactory.createOmmArrayEntry().intValue(QUOTE_DATE)); //3386
array.add(EmaFactory.createOmmArrayEntry().intValue(QUOTIM_MS)); //3855
array.add(EmaFactory.createOmmArrayEntry().intValue(SCALING)); //3754
array.add(EmaFactory.createOmmArrayEntry().intValue(START_DT));  //3791
this.view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
this.view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
<?xml version="1.0" encoding="UTF-8"?><EmaConfig>
<!-- ConsumerGroup provides set of detailed configurations to be used by named consumers  -->
<!-- Application specifies which configuration to use by setting OmmConsumerConfig::consumerName()  -->
<ConsumerGroup>  
<ConsumerList>  
<Consumer>  
<!-- Name is mandatory  -->  <Name value="fxp_consumer"/>  
<!-- Channel is optional: defaulted to "RSSL_SOCKET + localhost + 14002"  -->  <!-- Channel or ChannelSet may be specified  -->  
<Channel value="our_channel"/>  
<XmlTraceToStdout value="0"/>  
</Consumer>  </ConsumerList>
</ConsumerGroup>
<ChannelGroup>
<ChannelList>
<Channel>
<Name value="our_channel"/>
<!-- ChannelType possible values are:  -->
<!-- ChannelType::RSSL_SOCKET  - TCP IP connection type  -->
<!-- ::RSSL_HTTP  - Http tunnel connection type  -->
<!-- ChannelType::RSSL_ENCRYPTED - Https tunnel connection type  -->
<ChannelType value="ChannelType::RSSL_SOCKET"/> 
<Host value="{
  { reuters_host }}"/>
<Port value="{
  { reuters_port }}"/>
<GuaranteedOutputBuffers value="5000"/>
</Channel>
</ChannelList>
</ChannelGroup></EmaConfig>
elektronrefinitiv-realtimeelektron-sdktreprrtema-apielektron-message-api
icon clock
10 |1500

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

Upvotes
Accepted
1 1 0 2

The problem was with logback-configuration, where we use Async-appenders. When we changed to non-async logging for reurers' classes, the Concurrent/NulPointer/ArrayIndexOutOfBound errors disappeared.

icon clock
10 |1500

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

Upvotes
9.5k 10 5 7

Hello @m.vasilenko

I have reviewed your given configuration and it is proper. I also merged your given source code into example360__MarketPrice__View and requested EUR=TRB, EUR=, AUD=TRB. The application processed Update Messages successfully; there was no NullPointerException. Hence, you given source code to create view is proper as well.

Therefore, the possible root cause of the problem may be your application processes Update messages improperly or update messages (I did not request data the exact time you faced the problem) or EMA.

To find out the real root cause, please do the following

1. Enable EMA xml trace log to see the update messages the application received by setting XmlTraceToStdout in the configuration file to be 1 as shown below:

<XmlTraceToStdout value="1"/>

EMA xml trace log contains all messages EMA sends and receives to/from the server to the console.

2.Modify example360__MarketPrice__View application to request the same RICs and same fields from the same user, server and service as your application. Then, run your application and the modified example360__MarketPrice__View simultaneously with re-direct each console output to a file (EMA xml trace log plus the application output can be long).

If NullPointerException occurs with your application only, there is something wrong in your application when processing an update messages. In this case, you should review your application source code at onUpdateMsg(..) method and all methods called in onUpdateMsg(..). I suggest you add the source code to prints the stack trace of the Exception so you can know which line of source code relates/causes the problem.

If both applications get NullPointerException, please send us both output files containing EMA xml trace log and the Exception. Then, we can help you to investigate the problem.

icon clock
10 |1500

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

Hello @m.vasilenko

I also tested with updateMsg.toString() of ESDK SDK - Java - 1.2.0 as shown below:

public void onUpdateMsg(UpdateMsg updateMsg, OmmConsumerEvent event) 
{
   System.out.println(updateMsg.toString());
}

NullPointerException did not occurs as well. Please try to use ESDK SDK - Java - 1.2.0 with your application.

Please, look at the other answers with detailed errors from EmaIterator

Inside our build.gradle we use version of EMA API:

compile ('com.thomsonreuters.ema:ema:3.2.0.1')
Upvotes
1 1 0 2

Inside our build.gradle we use version of EMA API:

compile ('com.thomsonreuters.ema:ema:3.2.0.1')

We enabled tracing EMA logs and received more details about NullPointerException and find out additional error type ArrayIndexOutOfBoundsException

[2018-07-03 10:26:35.448] [DEBUG] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: [!!!com.thomsonreuters.ema.access.UpdateMsgImpl@6ad256df=>java.lang.NullPointerException:null!!!]

[2018-07-03 10:26:35.448] [WARN ] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding java.lang.NullPointerException: null

at java.util.LinkedList.get(LinkedList.java:477) ~[?:1.8.0_172]

at com.thomsonreuters.ema.access.FieldListImpl.clearCollection(FieldListImpl.java:559) ~[stormjar.jar:?]

at com.thomsonreuters.ema.access.FieldListImpl.fillCollection(FieldListImpl.java:329) ~[stormjar.jar:?]

at com.thomsonreuters.ema.access.FieldListImpl.iterator(FieldListImpl.java:99) ~[stormjar.jar:?]

at ru.sberbank.fxp.reuters.integration.mappers.ReutersMapperImpl.updateReutersDataImage(ReutersMapperImpl.java:77) ~[stormjar.jar:?]

at ru.sberbank.fxp.reuters.integration.ReutersConsumerClient.onUpdateMsg(ReutersConsumerClient.java:86) ~[stormjar.jar:?]

at com.thomsonreuters.ema.access.ItemCallbackClientConsumer.notifyOnUpdateMsg(ItemCallbackClient.java:2522) ~[stormjar.jar:?]

at com.thomsonreuters.ema.access.ItemCallbackClient.processUpdateMsg(ItemCallbackClient.java:1803) ~[stormjar.jar:?]

at com.thomsonreuters.ema.access.ItemCallbackClient.defaultMsgCallback(ItemCallbackClient.java:1607) ~[stormjar.jar:?]

at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendDefaultMsgCallback(Reactor.java:808) ~[stormjar.jar:?]

at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:823) ~[stormjar.jar:?]

at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2816) ~[stormjar.jar:?]

at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readUpdateMsg(WlItemHandler.java:2153) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1787) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Watchlist.readMsg(Watchlist.java:287) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.performChannelRead(Reactor.java:1758) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1389) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:469) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1129) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1262) ~[stormjar.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

[2018-07-03 10:23:35.909] [WARN ] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding java.lang.ArrayIndexOutOfBoundsException: -1 at com.thomsonreuters.upa.codec.Decoders.decodeFieldEntry(Decoders.java:2544) ~[stormjar.jar:?] at com.thomsonreuters.upa.codec.FieldEntryImpl.decode(FieldEntryImpl.java:140) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.FieldListImpl.fillCollection(FieldListImpl.java:343) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.FieldListImpl.iterator(FieldListImpl.java:99) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.mappers.ReutersMapperImpl.updateReutersDataImage(ReutersMapperImpl.java:77) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.ReutersConsumerClient.onUpdateMsg(ReutersConsumerClient.java:86) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClientConsumer.notifyOnUpdateMsg(ItemCallbackClient.java:2522) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.processUpdateMsg(ItemCallbackClient.java:1803) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.defaultMsgCallback(ItemCallbackClient.java:1607) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendDefaultMsgCallback(Reactor.java:808) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:823) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2816) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readUpdateMsg(WlItemHandler.java:2153) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1787) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Watchlist.readMsg(Watchlist.java:287) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.performChannelRead(Reactor.java:1758) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1389) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:469) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1129) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1262) ~[stormjar.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172] [2018-07-03 10:23:37.052] [DEBUG] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: UpdateMsg streamId="6" domain="MarketPrice Domain" updateTypeNum="1" name="AUD=TRB" serviceId="257" serviceName="IDN_SELECTFEED" Payload dataType="FieldList" FieldList FieldListNum="0" DictionaryId="1" FieldListEnd PayloadEnd UpdateMsgEnd [2018-07-03 10:23:37.053] [WARN ] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding java.lang.ArrayIndexOutOfBoundsException: -1 at com.thomsonreuters.upa.codec.Decoders.decodeFieldEntry(Decoders.java:2544) ~[stormjar.jar:?] at com.thomsonreuters.upa.codec.FieldEntryImpl.decode(FieldEntryImpl.java:140) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.FieldListImpl.fillCollection(FieldListImpl.java:343) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.FieldListImpl.iterator(FieldListImpl.java:99) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.mappers.ReutersMapperImpl.updateReutersDataImage(ReutersMapperImpl.java:77) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.ReutersConsumerClient.onUpdateMsg(ReutersConsumerClient.java:86) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClientConsumer.notifyOnUpdateMsg(ItemCallbackClient.java:2522) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.processUpdateMsg(ItemCallbackClient.java:1803) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.defaultMsgCallback(ItemCallbackClient.java:1607) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendDefaultMsgCallback(Reactor.java:808) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:823) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2816) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readUpdateMsg(WlItemHandler.java:2153) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1787) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Watchlist.readMsg(Watchlist.java:287) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.performChannelRead(Reactor.java:1758) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1389) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:469) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1129) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1262) ~[stormjar.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172] [2018-07-03 10:23:39.047] [DEBUG] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: [!!!com.thomsonreuters.ema.access.UpdateMsgImpl@6ad256df=>java.lang.ArrayIndexOutOfBoundsException:-1!!!] [2018-07-03 10:23:39.412] [DEBUG] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: UpdateMsg streamId="6" domain="MarketPrice Domain" updateTypeNum="1" name="AUD=TRB" serviceId="257" serviceName="IDN_SELECTFEED" Payload dataType="FieldList" FieldList FieldListNum="0" DictionaryId="1" FieldEntry fid="22" name="BID" dataType="Real" value="0.7375" FieldEntry fid="25" name="ASK" dataType="Real" value="0.7376" FieldEntry fid="3386" name="QUOTE_DATE" dataType="Date" value="03 JUL 2018" FieldEntry fid="3855" name="QUOTIM_MS" dataType="UInt" value="26618935" FieldListEnd PayloadEnd UpdateMsgEnd
icon clock
10 |1500

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

Upvotes
1 1 0 2

And ConcurrentModificationException from EmaIterator

[2018-07-03 10:23:43.414] [DEBUG] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: [!!!com.thomsonreuters.ema.access.UpdateMsgImpl@6ad256df=>java.lang.ArrayIndexOutOfBoundsException:-1!!!] [2018-07-03 10:23:43.415] [WARN ] [pool-198-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding java.util.ConcurrentModificationException: null at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966) ~[?:1.8.0_172] at java.util.LinkedList$ListItr.next(LinkedList.java:888) ~[?:1.8.0_172] at com.thomsonreuters.ema.access.EmaIterator.next(EmaIterator.java:30) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.mappers.ReutersMapperImpl.updateReutersDataImage(ReutersMapperImpl.java:77) ~[stormjar.jar:?] at ru.sberbank.fxp.reuters.integration.ReutersConsumerClient.onUpdateMsg(ReutersConsumerClient.java:86) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClientConsumer.notifyOnUpdateMsg(ItemCallbackClient.java:2522) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.processUpdateMsg(ItemCallbackClient.java:1803) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.ItemCallbackClient.defaultMsgCallback(ItemCallbackClient.java:1607) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendDefaultMsgCallback(Reactor.java:808) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:823) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2816) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readUpdateMsg(WlItemHandler.java:2153) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1787) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Watchlist.readMsg(Watchlist.java:287) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.performChannelRead(Reactor.java:1758) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:1389) ~[stormjar.jar:?] at com.thomsonreuters.upa.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:469) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1129) ~[stormjar.jar:?] at com.thomsonreuters.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1262) ~[stormjar.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

icon clock
10 |1500

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

Upvotes
9.5k 10 5 7

Hello @m.vasilenko

You are using the latest EMA,3.2.0.1 and the stack trace from all exceptions related to EMA/ETA(UPA). Hence, it is possible that these exceptions may be EMA/ETA bugs. To confirm this and get/speed up the solutions, please contact the development team who is EMA/ETA(UPA) source code expert and can help you on this. You can raise your problem to them directly via https://github.com/thomsonreuters/Elektron-SDK/issues then click "New issue" button. This way allows you to contact and follow up with the development team directly as well.

icon clock
10 |1500

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