How to run example of IProvider and Consumer applications?
I'm trying to run below commands as per the guide:
java -cp .;target/RTSDKJ_Maven-1.0-jar-with-dependencies.jar com.refinitiv.ema.provider.IProvider
java -jar ./target/RTSDKJ_Maven-1.0-jar-with-dependencies.jar
But both commands throws class not found exception. When I checked inside the jar file, I couldn't find the specific classes as well.
Can anyone help me to find how to run these commands?
Best Answer
-
Hello @hanhuitan
If your source code directory is based on the EMA Java source code like the following example.
Your pom.xml setting must be matched this directory structure as follows:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
com.refinitiv.ema.examples.training.consumer.series100.ex100_MP_Streaming.Consumer
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>Then you need to run the single-all-dependencies jar file with the following classpath
java -cp .;target/RTSDKJ_Maven-1.0-jar-with-dependencies.jar com.refinitiv.ema.examples.training.iprovider.series100.ex100_MP_Streaming.IProvider
java -jar ./target/RTSDKJ_Maven-1.0-jar-with-dependencies.jar1
Answers
-
Hello @hanhuitan
It seems the RTSDKJ_Maven-1.0-jar-with-dependencies.jar file does in included the Dependencies classes.
How did you build the jar? I am assuming that you are using Maven, did you set Maven to build a single-all-dependencies jar file in the pom.xml file?
You can find an example in the "Building the project" section of the How to Set Up Refinitiv Real-Time SDK Java Application with Maven article.
Please note that the classpath in a <manifest> tag must match the source code directory.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass><Main Class></mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>1 -
Hello @hanhuitan
Which version of the EMA API you are using?
- If you want to use EMA Java 3.6.7.0 L1 --> Please specify the EMA library version "3.6.7.1" in the pom.xml dependency setting
- If you want to use EMA Java 3.6.7.0 L2 --> Please specify the EMA library version "3.6.7.3" in the pom.xml dependency setting
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.refinitiv.ema</groupId>
<artifactId>ema</artifactId>
<version>${rtsdk.version}</version>
</dependency>Hope this helps.
1 -
Hi,
Can I get a maven example project instead of Gradle?
0 -
Hello @hanhuitan
The RTSDK Java is currently available with Gradle-based by default. However, you can submit a change request to the product team via the https://my.refinitiv.com/content/mytr/en/feedback.html page.
0 -
Hello @hanhuitan
The project above is based on the How to Set Up Refinitiv Real-Time SDK Java Application with Maven article, but you need to change the source code to the EMA Java example one.
Another practical step-by-step guide to set up an EMA Java examples project with Maven is the How to Set Up Real-Time SDK Java Application with Maven on the Eclipse IDE article.
As I said earlier, the RTSDK Java is available with Gradle-based by default. However, you can submit a change request to the product team via the https://my.refinitiv.com/content/mytr/en/feedback.html page.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛