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

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @hanhuitan

    If your source code directory is based on the EMA Java source code like the following example.
    ema-folder.png

    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.jar

Answers