Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by peng.xiaoliang · May 11, 2018 at 06:11 AM · treprfarfa-apiconsumerrdm

Read Resource file "RDMFieldDictionary" have some problem

In this method

QSConsumer.java
 
public void init()
    {
    	String fieldDictionaryFilename = "../etc/RDM/RDMFieldDictionary";
    	String enumDictionaryFilename = "../etc/RDM/enumtype.def";
    	try 
    	{
    		GenericOMMParser.initializeDictionary(fieldDictionaryFilename, enumDictionaryFilename);
    	}
    	catch (DictionaryException ex) 
    	{
    		System.out.println("ERROR: Unable to initialize dictionaries");
    		System.out.println(ex.getMessage());
    		if(ex.getCause() != null)
    			System.err.println(": " + ex.getCause().getMessage());
    		cleanup();
    		return;
    	}

    }

STEP1:

In this source code ,it wants to read RDMFieldDictionary ,

String fieldDictionaryFilename = "../etc/RDM/RDMFieldDictionary";

and i change the code to get the file's path like this

String fieldDictionaryFilename = Thread.currentThread().getContextClassLoader().getResource("rfa/RDMFieldDictionary").getFile();

and i got the result like this

/D:/workspace/xuntou-base-market/xuntou-base-market-facade/target/classes/rfa/RDMFieldDictionary

STEP2:

i start the project user Intellij (a IDE like Eclipse) in my own computer, it runs very well

public class RfaSubscribeThread implements Runnable{
   
    public void run() {

        // Create a demo instance
        QSConsumer demo = new QSConsumer();

        // Startup and initialization
        demo.init();
	//...
    }
}

STEP3:

But when the project has become a Jar File,and start up on the Linux Mechine ,it give me some wrong info like this

ERROR: Unable to initialize dictionaries
ERROR: Check if files file:/usr/local/xuntou/base-market/xuntou-base-market-facade/lib/xuntou-base-market-facade-1.1.9-SNAPSHOT.jar!/rfa/RDMFieldDictionary and file:/usr/local/xuntou/base-market/xuntou-base-market-facade/lib/xuntou-base-market-facade-1.1.9-SNAPSHOT.jar!/rfa/enumtype.def exist and are readable.
: Dictionary file file:/usr/local/xuntou/base-market/xuntou-base-market-facade/lib/xuntou-base-market-facade-1.1.9-SNAPSHOT.jar!/rfa/RDMFieldDictionary does not exist.
RWF: 14.1
RFA: Version = 8.1.0.E2.all, Date = Wed May 02 18:30:50 CST 2018, Jar Path = /usr/local/xuntou/base-market/xuntou-base-market-facade/lib/rfa-1.0.0.jar, Jar Size = 1619345


class com.xuntou.platform.market.rfa.quickstart.QuickStartConsumer.QSConsumer exiting

STEP4:

I seach the internet ,fount in the jar file , use "new File("FilePath")" to get file is not right

i want to change ,but the source code

GenericOMMParser.initializeDictionary(fieldDictionaryFilename, enumDictionaryFilename);

only use "new File('FilePath')" to read the resource file

So, what can i do to avoid the problem.

TIPS: I can't change the source code, it's provided by your company

expect your help, thank you very much!

tim截图20180511174657.png (9.3 KiB)
2.png (52.9 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 wasin.w · May 22, 2018 at 12:09 AM

Hello @peng.xiaoliang

Please be informed that this is an expected behavior. The TREP Dictionary files (RDMFieldDictionary and enumtype.def files) are always updated (add new supported fields, fixed dictionary issue, etc) by TR, so the application should place Dictionary files outside the Jar file to let you can easy upgrade them without rebuild the Jar file. You can download the latest version of TREP dictionary file from the Customer Zone https://customers.reuters.com/a/support/technical/softwaredownload/Default.aspx link (Please select Category “MDS – General” and Products “TREP Template Service Pack”).

Please be informed that the RFA API is a feature-completed API. The current strategic API is Elekton Message API (EMA Java API) which is a part of the strategic Elektron SDK family. You can find more detail regarding the EMA Java from the following resources

  • Elektron SDK – Java site
  • Developer Webinar: Introduction to Enterprise App Creation With Open-Source Elektron Message API
  • Developer Webinar Recording: Why migrate from RFA to EMA API?
Comment

People who like this

0 Show 3 · 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
peng.xiaoliang · May 30, 2018 at 09:56 PM 0
Share

it confused me. I still don't know how to solve this problem. The jar file and source code is provided, the only way to read the dictionary file is use the source code which is provided.

avatar image
peng.xiaoliang · May 30, 2018 at 10:02 PM 0
Share

Publish the project to the internet must park the source code to JAR file, but in the jar file ,it can't read the dictionary file . The helper website i can't open it .because of the GFW

avatar image
REFINITIV
wasin.w ♦♦ · May 30, 2018 at 11:43 PM 0
Share

Hello @peng.xiaoliang

The dictionary files are not designed to be inside the application Jar file because they are designed to be easy updated by just replacing the files. The application should place dictionary files outside the Jar file and read them from that location.

avatar image
REFINITIV
Answer by wasin.w · May 14, 2018 at 07:33 AM

Hello @peng.xiaoliang

I can replicate the issue with the given code. When the application keeps Dictionary files with resources folder and build jar file, the following code cannot access Dictionary files inside jar file:

fieldDictionaryFilename = Thread.currentThread().getContextClassLoader().getResource("etc/RDMFieldDictionary").getFile();
enumDictionaryFilename = Thread.currentThread().getContextClassLoader().getResource("etc/enumtype.def").getFile();

Then I got the following error message when I try to run the jar file.

ERROR: Unable to initialize dictionaries
ERROR: Check if files file:/D:/Project/SRs/AHS_27324/Code/RFA_code/out/artifacts
/RFA_OMM_AHS_27324_jar/RFA_OMM_AHS_27324.jar!/etc/RDMFieldDictionary and file:/D
:/Project/SRs/AHS_27324/Code/RFA_code/out/artifacts/RFA_OMM_AHS_27324_jar/RFA_OM
M_AHS_27324.jar!/etc/enumtype.def exist and are readable.
: Dictionary file file:/D:/Project/SRs/AHS_27324/Code/RFA_code/out/artifacts/RFA
_OMM_AHS_27324_jar/RFA_OMM_AHS_27324.jar!/etc/RDMFieldDictionary does not exist.

I will check this behavior in detail and let you know updates.


ahs.png (12.3 KiB)
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.

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 >
9 People are following this question.

Related Questions

Multiple DACSId/LoginIds using same rfa Session for Consumer Application...

RFA C++ consumer application dis not reconenct to ADS

Why does OMM provider logs "RSSL Channel read failed on connection" when OMM consumer shuts down?

Subscribing to RIC multiple times

How to use single session supporting multiple users for remote authentication in SSL RFA Java Subscriber?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • 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
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges