question

Upvotes
Accepted
3 1 2 1

Getting java.lang.NoSuchFieldError: INSTANCE exception on Apache layer while connecting using Keystore.

Hi,

We are facing an issue while creating the market data session in linux environment.

The same application when run on my dvelopment environment, it runs fine.

But when deployed in another linux environment, it is getting an exception on Apache layer as follows.

Exception in thread "Thread-293" java.lang.NoSuchFieldError: INSTANCE

at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)

at com.thomsonreuters.upa.valueadd.reactor.RestReactor.<init>(RestReactor.java:113)

at com.thomsonreuters.upa.valueadd.reactor.RestClient.<init>(RestClient.java:67)

at com.thomsonreuters.upa.valueadd.reactor.Reactor$1.<init>(Reactor.java:926)

at com.thomsonreuters.upa.valueadd.reactor.Reactor.createRestClient(Reactor.java:925)

at com.thomsonreuters.upa.valueadd.reactor.Reactor.connect(Reactor.java:595)

at com.thomsonreuters.ema.access.ChannelCallbackClient.initializeReactor(ChannelCallbackClient.java:821)

at com.thomsonreuters.ema.access.ChannelCallbackClient.initializeConsumerRole(ChannelCallbackClient.java:899)

at com.thomsonreuters.ema.access.OmmConsumerImpl.handleAdminDomains(OmmConsumerImpl.java:443)

at com.thomsonreuters.ema.access.OmmBaseImpl.initialize(OmmBaseImpl.java:270)

at com.thomsonreuters.ema.access.OmmConsumerImpl.<init>(OmmConsumerImpl.java:43)

at com.thomsonreuters.ema.access.EmaFactory.createOmmConsumer(EmaFactory.java:165)


I am using the following apache libraries.

commons-configuration-1.10.jar

commons-collections-3.2.2.jar

commons-lang-2.6.jar

commons-logging-1.2.jar

httpclient-4.5.jar

httpclient-cache-4.5.jar

httpcore-4.4.1.jar

httpcore-nio-4.4.10.jar

httpmime-4.5.jar

jcip-annotations.jar


If you can suggest a pointer to understand what is going wrong here, it will be of great help.

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apiexception
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.

11 Answers

Upvotes
Accepted
28.3k 30 11 15

Hello @banerjees,

I notice that you include many other jars, some of which may include the same classes, which makes it very hard for you to find what causes the exception that you are seeing.

One approach I would use, if I was seeing this on linux in a custom app, without an obvious double-inclusion of httpcore, is go back to the basics, get the smallest common denominator running, then build up from there. Let me try to explain.

Are you connecting to ERT, from EMA Java, using local key store?

in Elektron SDK, EMA Java, example consumer 113 does that and exactly that. I would, on linux, run this example, setting classpath to only to the jars needed by this example.

Once this works on the linux where you are seeing the issue, try this example with the classpath you are currently setting. See if it chocks the example, or it is still able to run. If the exmaple runs on the minimal classpass but also chocks on the full classpath, the issue is definitely on this full classpath.

If it is still able to run,with the full classpass, you may need to look further into the code of your app, and compare to the example code, see where the ambiguity in the call may be coming in.

Roughly, this is the strategy I would use, hope it helps.

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
28.3k 30 11 15

Hello @banerjees,

You may find this discussion helpful, this seems to be related to having the multiple versions of httpcore jar found in path.

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 1 2 1

Hi Zoya,

I did chack the classpath and only one version of httpcore jar is mapped in this case. I am pasting the entire java command and classpath details for the reference. Still we are facing the issue on LINUX environment. In windows environment at my local setup, it is working fine.

#Set the Integral environment

if [ -f $INST_HOME/bin/setEnv.sh -o -f $INST_HOME/bin/setClassPath.sh ]

then

. $INST_HOME/bin/setEnv.sh

. $INST_HOME/bin/setClassPath.sh

fi


DIRNAME=`dirname $0`

PROGNAME=`basename $0`

GREP="grep"

echo "Starting $INST_HOME ...."

JAVA=$JAVA_HOME/bin/java

JAVAC_JAR=$JAVA_HOME/lib/tools.jar

#JAVA_OPTION="$JAVA_OPTION -Dprogram.name=$INST_HOME/bin/$PROGNAME -Dlog4j.configuration=file:$INST_HOME/integral5/properties/log4j.properties"

JAVA_OPTION="$JAVA_OPTION -Dprogram.name=$INST_HOME/bin/$PROGNAME"


$JAVA $JAVA_OPTION -classpath "$CLASSPATH" com.integral.adaptor.application.MultiTenantAdaptorLaunchPad


#setclasspath.sh

export CLASSPATH="../integral5/AdaptorCommon.jar:$CLASSPATH"

export CLASSPATH="../integral5/AdaptorConfig.jar:$CLASSPATH"

export CLASSPATH="../integral5/CommonAdaptorProtocol.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors.jar:$CLASSPATH"

export CLASSPATH="../integral5/AdaptorLogger.jar:$CLASSPATH"


export CLASSPATH="../integral5/lib/IntegralCoreCommon.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/IntegralCoreDomain.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/Multicast.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaces.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/messaging.jar:$CLASSPATH"



export CLASSPATH="../integral5/lib/IFSThirdParty.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/jctools/jctools-core-1.1.jar:$CLASSPATH"


export CLASSPATH="../integral5/lib/apache/commons/commons-beanutils.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/commons/commons-collections.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/commons/commons-lang-2.2.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/commons/commons-logging.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/httpclient-4.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/httpclient-cache-4.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/httpcore-4.4.1.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/httpcore-nio-4.4.10.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/httpmime-4.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/apache/httpcomponents/jcip-annotations.jar:$CLASSPATH"


export CLASSPATH="../integral5/lib/BerkeleyDB/je-5.0.34.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/jacksonjson/jackson-core-asl-1.9.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/jacksonjson/jackson-mapper-asl-1.9.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/logging/slf4j-api-1.6.3.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/logging/log4j-1.2.15.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/logging/logback-classic-1.0.6.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/logging/logback-core-1.0.6.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/netty/netty-3.2.4.Final.jar:$CLASSPATH"


export CLASSPATH="../integral5/lib/quickfixj_integral_build/mina-core-1.1.7.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/quickfixj_integral_build/mina-filter-ssl-1.1.7.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/quickfixj_integral_build/quickfixj-all-1.5.3.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/restlet/org.restlet.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/jetty/jetty-all-7.0.2.v20100331.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/jetty/servlet-api-2.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/disruptor/disruptor-2.8.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/mongo/mongo-java-driver.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaceslib/bson4jackson-2.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaceslib/jackson-annotations-2.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaceslib/jackson-core-2.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaceslib/jackson-databind-2.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/spaceslib/javassist-3.12.1.GA.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-cme-adaptor-2.13.3.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/commons-cli-1.2.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/commons-configuration-1.8.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-adaptor-api-2.14.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-cme-channel-beans-2.14.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-cme-market-data-2.14.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-cme-xmlbeans-2.14.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-cmefastadaptor-util-2.14.5.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fast-engine-2.14.5-small.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-common-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-engine-2.11.13-small.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-engine-config-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-engine-encryption-api-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-engine-encryption-impl-2.11.13-small.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-message-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-tags-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/epam/fixaj-xml-2.11.13.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/matchingvenue/mv-do.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/matchingvenue/mv-container.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/rabbitmq/rabbitmq-client.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/aeron/aeron-client-1.3.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/aeron/aeron-driver-1.3.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/aeron/agrona-0.9.6.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/aeron/mv-commons-2.0.0-SNAPSHOT.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/platform/services-0.1.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/curator-client-2.5.0:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/zookeeper-3.4.6.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/curator-client-2.5.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/curator-framework-2.5.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/curator-recipes-2.5.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/curator-x-discovery-2.5.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/lib/zookeeper/guava-17.0.jar:$CLASSPATH"


export CLASSPATH="../integral5/Adaptors/lib/FXAllAdaptor/tcpi-4.1.0.1.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/GFXAdaptor/netty-all-4.0.12.Final.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/REUTERSAdaptor/rfa-7.2.1.L1.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/BLMBRGAdaptor/blpapi3.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/ema-3.3.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/ansipage-3.3.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/json-20180130.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/upa-3.3.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/upaValueAdd-3.3.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/upaValueAddCache-3.3.0.0.jar:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/lib/RTRETRONAdaptor/xpp3-1.1.4c.jar:$CLASSPATH"


export CLASSPATH="../devsetup/usrv:$CLASSPATH"

export CLASSPATH="../integral5/:$CLASSPATH"

export CLASSPATH="../integral5/properties:$CLASSPATH"

export CLASSPATH="../integral5/CAP/properties:$CLASSPATH"

export CLASSPATH="../integral5/Adaptors/properties:$CLASSPATH"

export CLASSPATH="../integral5/lib/:$CLASSPATH"




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 1 2 1

Thanks Zoya for the suggestion. I will update the result after doing the exercise.

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 1 2 1

Thanks Zoya for all the support.

I found the reason behind the issue. One of the existing jar file has inbuild httpcomponent which was an older version than the newer one we needed for Reuter Elektron. After removing that jar from the classpath, the issue got reolved.

export CLASSPATH="../integral5/Adaptors/lib/REUTERSAdaptor/rfa-7.2.1.L1.jar:$CLASSPATH"

Above jar file was the culprit.

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 1 2 1

Hi Zoya,

After going through all the included jars, I found an old Reuter jar file has older httpcomponent files included in its jar, which was causing conflict with the newer version added to support Reuter Elektron.

export CLASSPATH="../integral5/Adaptors/lib/REUTERSAdaptor/rfa-7.2.1.L1.jar:$CLASSPATH"

After removing the above jar file from the classpath, the exception get resolved.

But we are getting the below login failure callback from Reuter Elektron.

2020-01-14 12:07:23,880 WARN Thread-332 OmmConsumerImpl loggerMsg

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_4

RsslReactor @207181dd

RsslChannel @611fc52d

Error Id 0

Internal sysError 0

Error Location Reactor.processWorkerEvent

Error text Error - exceeded initialization timeout (5 s)

loggerMsgEnd

020-01-16 07:34:33,728 ERROR Thread-329 OmmConsumerImpl loggerMsg

ClientName: Consumer_3_1

Severity: Error

Text: login failed (timed out after waiting 45000 milliseconds) for :)

loggerMsgEnd



2020-01-16 07:34:33,730 ERROR Thread-329 OmmConsumerImpl loggerMsg

ClientName: ChannelCallbackClient

Severity: Error

Text: Received ChannelDown event on channel Channel_4

Instance Name Consumer_3_1

RsslReactor @3fa19d65

RsslChannel @3414d17d

Error Id -1

Internal sysError 0

Error Location Reactor.encodeAndWriteLoginRequest

Error text Failed to obtain an action channel

loggerMsgEnd

We are using the same keystore file, keystore password, userID and user Pwd to connect, which is giving login success and transmitting rates when I am trying to connect using the same application from my local setup.

I am using Consumer_3 and Channel_4 from EMAConfig.xml to connect.

<Channel>

<Name value="Channel_4"/>

<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>

<CompressionType value="CompressionType::None"/>

<GuaranteedOutputBuffers value="5000"/>

<!-- EMA discovers a host and a port from EDP-RT service discovery for the specified location

when both of them are not set and the session management is enable. -->

<Location value="us-east"/>

<EnableSessionManagement value="1"/>

<!-- ObjectName is optional: defaulted to "" -->

<ObjectName value=""/>

</Channel>

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
28.3k 30 11 15

Hello @banerjees,

This is different from the original question. Let's step back and I try to better understand the requirement and the environment?

Are you running one of our examples to connect to ERT or are you integrating a custom app?

If this is your first connection to ERT on a machine, I would recommend connecting with a simple example first, then merging the working connection code into your custom app.

Between the two APIs available EMA and ETA, I would recommend EMA, as ease of use, less coding effort for you choice. If you do, I would recommend reviewing EMA Quick Start - Connecting to Elektron Real Time in Cloud that uses example 450 from EMA Java SDK and running it successfully, then integrating into your app.

Alternatively, if you prefer ETA, it's more coding, but also more flexibility in terms of the implementation, if that is the case, review ETA Quick Start - Connecting to Elektron Real Time in Cloud , get it running, then integrate into your app.

Please be note that RFA 7.2 has been end-of-lifed and not supported for a long time, so it would be advisable not to have it in path.

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
1 0 0 2

Zoya-

Let me backup a step.

We are integrating a custom app using the EMA examples as a guide. Thank you for your help so far - as the application is working on Sarthak's development laptop ( this is using machine id GE-A-00336937-3-2527 )

The issue we are now facing is moving the working version of the code off his laptop to our QA environment ( this is when the classpath issues were faced. ). We are using machine id GE-A-00336937-3-2528, along with the same keystore file, keystore password, userID and user Pwd to connect, but the error below is being displayed when running in the QA environment,

At this point, would it be possible to have a call with our developers to find out what is going wrong?

Thanks

Sunil


2020-01-14 12:07:23,880 WARN Thread-332 OmmConsumerImpl loggerMsg

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_4

RsslReactor @207181dd

RsslChannel @611fc52d

Error Id 0

Internal sysError 0

Error Location Reactor.processWorkerEvent

Error text Error - exceeded initialization timeout (5 s)

loggerMsgEnd

020-01-16 07:34:33,728 ERROR Thread-329 OmmConsumerImpl loggerMsg

ClientName: Consumer_3_1

Severity: Error

Text: login failed (timed out after waiting 45000 milliseconds) for :)

loggerMsgEnd



2020-01-16 07:34:33,730 ERROR Thread-329 OmmConsumerImpl loggerMsg

ClientName: ChannelCallbackClient

Severity: Error

Text: Received ChannelDown event on channel Channel_4

Instance Name Consumer_3_1

RsslReactor @3fa19d65

RsslChannel @3414d17d

Error Id -1

Internal sysError 0

Error Location Reactor.encodeAndWriteLoginRequest

Error text Failed to obtain an action channel

loggerMsgEnd


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
28.3k 30 11 15

Hello @sunil.makhijani,

So we can be assured that if the custom application is working on Sarthak's development laptop and not working in QA environment, it is not the application itself, that is good and it is something else, configuration or environment that is preventing the connection.

I would try a couple of things to pinpoint what:

  • Using the second machine id (28) from the development laptop
  • Verifying connectivity to ERT from QA environment? (this one is very common, as connectivity differs)
  • If both verify, running a naked EMA ERT example on QA environment, to see if it manifests the same issue as the custom app

These completed, and not able to find a cause, please email me at zoya.farberov@refinitiv,com and will set up a call.

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 1 2 1

Hi Zoya,

The login issue has been resolved. It was a connectivity issue between QA machine to ERT.

We need to get some clarification regarding the httpcomponent version conflict issue we discussed earlier due to which we started this thread. As I mentioned earlier, the EMA jar we are using for our development, needs us to use the httpcomponent version 4.5.

But we are also having rfa-7.2.1.L1.jar for another Reuter adaptors and this jar internally has an older version of httpcomponent jar.

We had to overwrite the httpcomponent version to 4.5 in our application for the sake of Reuter Elektron adaptor.

Can you please confirm if the said Reuter library "rfa-7.2.1.L1.jar" will be compatible with this new httpcomponet version 4.5?

We can not remove this old Reuter library from our applications's classpath as the old adaptors Reuter Matching API and WM Reuters are still in our production which are using this library file.

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
9.5k 10 5 7

Hello @banerjees

All Apache classes has been removed from rfa.jar and added in a new directory 'ApacheClient' under the 'Libs' directory since RFA 7.4.0.E1 . However, the latest supported RFA is 7.6.x (providing MarketData and OMM interface) and 8.x(provide OMM interface). RFA 7.2.x is end of life and no longer support. RFA Java packages are available at Downloads page. If you face any difficulties downloading the package, please contact rdc.administrator@refinitiv.com

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.