question

Upvote
Accepted
39 1 0 5

NullPointerException in notifyOnAllMsg

I keep getting this error at random intervals (to clarify, it happen once every couple of days, but the timings are not repeatable). I know there are other similar questions, but they all date from years ago and are marked as fixed.

Does anyone have any idea what might be causing this?

java.lang.NullPointerException
        at com.refinitiv.ema.access.ItemCallbackClientConsumer.notifyOnAllMsg(ItemCallbackClient.java:2561)
        at com.refinitiv.ema.access.ItemCallbackClient.statusEventCallback(ItemCallbackClient.java:1167)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendTunnelStreamStatusEventCallback(Reactor.java:2208)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleTunnelStreamStatusEventCallback(Reactor.java:2220)
        at com.refinitiv.eta.valueadd.reactor.Reactor.handleTunnelStreamMsg(Reactor.java:5827)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:2097)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2943)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1987)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.serviceDeleted(WlItemHandler.java:2809)
        at com.refinitiv.eta.valueadd.reactor.WlServiceCache.clearCache(WlServiceCache.java:187)
        at com.refinitiv.eta.valueadd.reactor.WlDirectoryHandler.deleteAllServices(WlDirectoryHandler.java:759)
        at com.refinitiv.eta.valueadd.reactor.WlDirectoryHandler.deleteAllServices(WlDirectoryHandler.java:1359)
        at com.refinitiv.eta.valueadd.reactor.Watchlist.channelDown(Watchlist.java:455)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleChannelEventCallback(Reactor.java:2055)
        at com.refinitiv.eta.valueadd.reactor.Reactor.performChannelRead(Reactor.java:3488)
        at com.refinitiv.eta.valueadd.reactor.Reactor.dispatchChannel(Reactor.java:2672)
        at com.refinitiv.eta.valueadd.reactor.ReactorChannel.dispatch(ReactorChannel.java:610)
        at com.refinitiv.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1543)
        at com.refinitiv.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1685)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
#technologyema-apijava
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
81k 264 53 75

@JasonS

Thanks for reaching out to us.

Please check if you are using the latest version of Refinitiv Real-Time SDK Java 2.0.7.L1 (EMA/ETA 3.6.7.L1). If not, please upgrade the application to use the latest version to avoid all known issues.

You can download the SDK from here or get it from maven.

Please feel free to reach out if you have any further questions.

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.

I have now upgraded to version 3.6.8.0 and I am still getting this error intermittently

INFO: StatusMsg
    streamId="8"
    domain="System Domain"
    privateStream
    state="Closed, Recoverable / Suspect / None / 'socket channel is not in the active state for getBuffer'"
    name="TUNNEL1"
    serviceId="10"
    serviceName="DDS_TRCE"
StatusMsgEnd

Exception in thread "pool-6-thread-1" java.lang.NullPointerException
Upvotes
1 0 0 3

I use the latest SDK 3.7.0.0 the problem is still there

Exception in thread "pool-5-thread-1" java.lang.NullPointerException: Cannot invoke "com.refinitiv.ema.access.OmmConsumerClient.onAllMsg(com.refinitiv.ema.access.Msg, com.refinitiv.ema.access.OmmConsumerEvent)" because the return value of "com.refinitiv.ema.access.Item.client()" is null
        at com.refinitiv.ema.access.ItemCallbackClientConsumer.notifyOnAllMsg(ItemCallbackClient.java:2580)
        at com.refinitiv.ema.access.ItemCallbackClient.statusEventCallback(ItemCallbackClient.java:1185)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendTunnelStreamStatusEventCallback(Reactor.java:3044)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleTunnelStreamStatusEventCallback(Reactor.java:3056)
        at com.refinitiv.eta.valueadd.reactor.Reactor.handleTunnelStreamMsg(Reactor.java:8276)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:2925)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:3029)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:2002)
        at com.refinitiv.eta.valueadd.reactor.WlItemHandler.serviceDeleted(WlItemHandler.java:2893)
        at com.refinitiv.eta.valueadd.reactor.WlServiceCache.clearCache(WlServiceCache.java:346)
        at com.refinitiv.eta.valueadd.reactor.WlDirectoryHandler.deleteAllServices(WlDirectoryHandler.java:762)
        at com.refinitiv.eta.valueadd.reactor.WlDirectoryHandler.deleteAllServices(WlDirectoryHandler.java:1362)
        at com.refinitiv.eta.valueadd.reactor.Watchlist.channelDown(Watchlist.java:516)
        at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleChannelEventCallback(Reactor.java:2721)
        at com.refinitiv.eta.valueadd.reactor.Reactor.performChannelRead(Reactor.java:5053)
        at com.refinitiv.eta.valueadd.reactor.Reactor.dispatchAll(Reactor.java:7705)
        at com.refinitiv.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:1771)
        at com.refinitiv.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1920)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

The error is written to the system out, despite the fact that I have properly configured logger, which gives me a hint that something bad happens inside SDK itself.

But the real problem actually (it is actually more like a blocker rather than an issue) after getting this error 'socket channel is not in the active state for getBuffer' automatic connection rollover/reconnect stops working. What is even worse I cannot call "ommConsumer.uninitialize();" as it blocks forever. I keep trying to figure out how am I supposed to recover from this error without application restart.

Some details on our configuration:
Our application contributes directly to Refinitiv via interactive consumer similar to the configuration described here https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java/tutorials/ema-consumer/ema-consumer-posting-data-to-contribution-channel#five

What is strange that I noticed that this error happens on Saturdays only. It has already happened at least 3 weeks in a row. Could it be a coincidence? Could it be related to the fact that markets are closed and no data are sent via the channel? in any case this error is very bad and I am not able to figure out how to recover the connection after it happens.

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 0 0 3

I did some tests in order to reproduce the problem. For that, I build SDK to produce Nullpointer exception at com.refinitiv.ema.access.ItemCallbackClientConsumer.notifyOnAllMsg(ItemCallbackClient.java:2580) on every 10th message. It appears that if Nullpointer exception is thrown the tunnel/channel is invalidated - which is I guess expected. However, the problem is that when we try to register tunnel/channel again like:

 tunnelStreamHandle = ommConsumer.registerClient(tunnelStreamRequest, this); 

tunnelStreamHandle is set to 0 - as of my understanding it is not a valid handle. So I modified a connection recovery logic in my application to treat 0 as the invalid handle and now I am able to restore the connection.

However, my 'artificially' generated error is only partially reproduces the real situation. In the real case scenario Nullpointer exception is produced after the following error message is written to the log

[pool-5-thread-1] ConsumerClient - Status message: StatusMsg
    streamId="7"
    domain="System Domain"
    privateStream
    state="Closed, Recoverable / Suspect / None / 'socket channel is not in the active state for getBuffer'"
    name="CONTRIBUTION_TUNNEL"
    serviceId="10"
    serviceName="DDS_TRCE"
StatusMsgEnd

I hope it does not mean that some internal buffers are corrupted and connection can be restored. We'll see it over this weekend...

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
81k 264 53 75

@JasonS @nabdullayev

You need to contact the API support team (Refinitiv Developer Connect) via Contact Premium Support to investigate this issue. However, you need to be a Refinitiv Developer Connect named user to submit an issue to Refinitiv Developer Connect.

Otherwise, you can contact the development team directly by opening a new issue on GitHub.


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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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