question

Upvotes
Accepted
3 0 0 3

Error when running EMA Java 3.8.0.0 with JDK1.8.x

I'm trying to upgrade EMA 3.5.1.0 to EMA 3.8.0.0. Our current JDK version is 1.8.x. While starting the server with the new version, there is an error below:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2024-07-02 17:37:02.154 ERROR 21070 --- [main] com.om.dpf.pserv.PservErrorListener : java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;


java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;

at com.refinitiv.eta.codec.BufferImpl.copy(BufferImpl.java:130)

at com.refinitiv.eta.valueadd.reactor.ReactorOptions.copy(ReactorOptions.java:499)

at com.refinitiv.eta.valueadd.reactor.Reactor.<init>(Reactor.java:287)

at com.refinitiv.eta.valueadd.reactor.ReactorFactory.createReactor(ReactorFactory.java:117)

at com.refinitiv.ema.access.OmmBaseImpl.initialize(OmmBaseImpl.java:323)

at com.refinitiv.ema.access.OmmConsumerImpl.<init>(OmmConsumerImpl.java:47)

at com.refinitiv.ema.access.EmaFactory.createOmmConsumer(EmaFactory.java:237)

at com.om.dpf.pserv.server.provider.reuters.ema.EMASessionFactory.start(EMASessionFactory.java:27)

Do we have to upgrade JDK to 1.11 or 1.17 to be compatible with EMA 3.8.0.0?
If not, how to resolve that issue above?

#technologyema-apijava-8
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.

Upvotes
Accepted
24.3k 62 15 21
Hi @fanghua.liu​,

This version of EMA 3.8 is the latest.

You can raise this issue at the RTSDK GitHub, where the developers of the SDK will be able to verify, and add it to the roadmap for the fix in the subsequent releases of the SDK.


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.

Upvote
24.3k 62 15 21

Hello @fanghua.liu,

EMA Java is supported on JDK 1.8.x as shown in the API compatibility matrix and on the readme page of the SDK github page.

It seems like Java has changed the signature of the nio Bytebuffer and its internal implementation of the flip() method. There are few suggestions on the internet regarding how to force the compiler to generate for a specific Java version. You can try these suggestions, namely -

javac --source 1.8 --target 1.8


https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip

https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/

If you are still having issues, can you provide a reproducable example, which I can try to compile to see this error, and suggest fixes.

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.

Upvotes
3 0 0 3

Hi @Gurpreet

Thanks for the reply!

I found that in JDK8, position(int) in Buffer class in rt.jar is public final method which ByteBuffer is not able to inherit. But in JDK9 or plus versions, the method in Buffer class is changed to public type. So when I built a ran EMA3.8 on JDK8, I have had this error.

Also, which EMA version is the stablest and do you recommend us upgrade to?

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.

Hello @fanghua.liu

Alternatively, if you are the RDC named user you can submit a support ticket to the Real-Time APIs Support team (RDC) to verify this issue in detail.
You can submit a ticket by clicking the "contact premium support" botton on the https://developers.lseg.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java page.

rtsdk-contact-support.png

Upvotes
27k 65 17 14

Hello @fanghua.liu

I re-checked the RTSDK 2.2.0.L1 (EMA 3.8.0.0). I found that the README file mentions the supported Java version as follows:

#### Supported Java Version 
The Refinitiv Real-Time-SDK supports Oracle JDK 1.11 & 1.17, OpenJDK 1.11 & 1.17, Amazon Corretto 11.

#### Tested Versions
This release has been tested with the following:

    Oracle Java SE 11 (JDK1.11)
    Oracle Open JDK (1.11)
    Oracle Open JDK (1.17)
    Amazon Corretto 11

It seems the EMA 3.8.0.0 does not support Java 8 anymore.

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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