Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
REFINITIV
Question by Xiaorong.Xu · Jan 06 at 06:47 AM · javaeaas

NullPointerException when printing FieldList content from update message to screen

Hi

When developing API according to Real-Time-SDK-2.0.0.L1.java, our client met NullPointerException when trying to print message content to screen in debug mode. Please find below screenshot:

However when print whole message which includes field list, it works. Please find below, the one in red circle are what client trying to extract:

Could you please help:

1. How to detect what was the cause of nullpointer?

2. If there any alternative way to locate and extract certain field from an message?

Thank you

image001.jpg (349.0 KiB)
image002.jpg (264.1 KiB)

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Jan 06 at 09:21 AM

Hi @Xiaorong.Xu

Is the client accessing the Msg Payload outside the EMA thread e.g. they are trying to access the payload after returning from OnUpdateMsg handler?

The EMA API owns the Msg and you cannot access it once you have returned from the event Handler callback e.g. onRefreshMsg(), onUpdateMsg() etc.

If they want to access the Msg after returning from the above callbacks, then they should clone the msg before using in a different thread e.g.

public void onUpdateMsg(UpdateMsg updateMsg, OmmConsumerEvent event)
{
    UpdateMsg clonedUpdMsg = EmaFactory.createUpdateMsg(updateMsg);
    // store / pass clonedUpdMsg for use in other thread..
    //......
    return;
}
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by Xiaorong.Xu · Jan 06 at 02:47 PM

Thank you very much Nalla. Problem resolved.

Comment
umer.nalla

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
umer.nalla ♦♦ · Jan 06 at 02:49 PM 0
Share

And thank you too, for getting back and confirming - much appreciated.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Invalid Field

Requesting and reading illogical FIDs

Where can I find details on the EMA instrument update message types?

Java EmaConfig.xml file for example310__MarketByOrder__Streaming when launching through gradlew

How to filter with certain fields

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges