1 0 0 0

EMA API : OmmInvalidUsageException error code : 4048

We noted below error message related to OmmInvalidUsage Exception with error code : 4048, this can happen several time per day. any help on issue identification is welcome.

Error message:

Exception in thread "pool-2-thread-1" Exception Type='OmmInvalidUsageException', Text='Attempt to state() while it is NOT set.', Error Code='-4048'

at com.refinitiv.ema.access.MsgImpl.ommIUExcept(

at com.refinitiv.ema.access.StatusMsgImpl.state(

at marketprice.MarketPriceImpl.onStatusMsg(

at com.refinitiv.ema.access.ItemCallbackClientConsumer.notifyOnStatusMsg(

at com.refinitiv.ema.access.ItemCallbackClient.processStatusMsg(

at com.refinitiv.ema.access.ItemCallbackClient.defaultMsgCallback(

at com.refinitiv.eta.valueadd.reactor.Reactor.sendDefaultMsgCallback(

at com.refinitiv.eta.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(

at com.refinitiv.eta.valueadd.reactor.WlItemHandler.callbackUser(

at com.refinitiv.eta.valueadd.reactor.WlItemHandler.readStatusMsg(

at com.refinitiv.eta.valueadd.reactor.WlItemHandler.readMsg(

at com.refinitiv.eta.valueadd.reactor.Watchlist.readMsg(

at com.refinitiv.eta.valueadd.reactor.Reactor.processRwfMessage(

at com.refinitiv.eta.valueadd.reactor.Reactor.performChannelRead(

at com.refinitiv.eta.valueadd.reactor.Reactor.dispatchChannel(

at com.refinitiv.eta.valueadd.reactor.ReactorChannel.dispatch(

at com.refinitiv.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(


at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$


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.

1 Answer

18.4k 50 13 19

Hi @y.attar,

It looks like your app is trying to get the null State object in the status callback function. Please add a validation check before accessing the object - something like:

public void onStatusMsg(StatusMsg msg, OmmConsumerEvent event) {
  if(msg.hasState()) {
    // get the OMM State message
    OmmState st = msg.state();

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.

Hi Gurpreet,
Thanks a lot for your help, I'll do the necessary as suggested and initiate connection for test.

Kind Regards