question

Upvotes
Accepted
1 0 0 0

RFA Jar NullPointer in RwfEncoder

During application startup we started seeing random instances of the application going into a state where every time the user tries to login after the initial application login/data dictionary download they would get a null pointer on this line.

Error:

Caused by: java.lang.NullPointerException: null at com.reuters.rfa.internal.rwf.RwfEncoder.initialize(Unknown Source)

Code in question:

ommEncoder.initialize(OMMTypes.MSG, 5000);

ommMsg = ommPool.acquireMsg();

ommMsg.setMsgType(OMMMsg.MsgType.REQUEST);

ommMsg.setMsgModelType(RDMMsgTypes.LOGIN);

ommMsg.setIndicationFlags(OMMMsg.Indication.REFRESH);

ommMsg.setAttribInfo(null, credential.getUserName(), RDMUser.NameType.USER_NAME);

ommEncoder.encodeMsgInit(ommMsg, OMMTypes.ELEMENT_LIST, OMMTypes.NO_DATA);

ommEncoder.encodeElementListInit(OMMElementList.HAS_STANDARD_DATA, (short) 0, (short) 0);

ommEncoder.encodeElementEntryInit(RDMUser.Attrib.ApplicationId, OMMTypes.ASCII_STRING);


Any knowledge of what is inside this method that could be null would help a lot in troubleshooting this issue.

rfa version: rfa-8.0.1.E3

treprfarfa-api
icon clock
10 |1500

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

Upvotes
Accepted
11.5k 16 7 10

Hi @carl_miller

Thank you for the information. If multiple threads are accessing or using the same OMMEncoder object at the same time, the exception can occur. Hence, the same OMMEncoder object used by multiple threads should be synchronized.

However, the race condition issue should happen even before re-deploying. I suggest you contact the API support team for a detailed investigation via the Contact premium support button on the following pages:



rtsdk-java.png (65.0 KiB)
rfa-java.png (94.7 KiB)
icon clock
10 |1500

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

Upvotes
11.5k 16 7 10

Hello @carl_miller

Does the issue occur when the application creates the OMM request message or after application login/data dictionary download success?

Can you replicate the issue with RFA Java StarterConsumer example? Can you share full stack trace and error messages?

icon clock
10 |1500

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

Its after the applications login/data dictionary download. The dacs id for that initial login will still be able to grab data. The issue only occurs for the next user trying to login.

Let me take a look at the RFA Java StarterConsumer, but currently this started happening for code taking live consumers for a year beforehand and only seemed to surface during initial deploys/re deploys of the application recently. It also only occurs sporadically.



Upvotes
1 0 0 0

stack_trace: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

at com.hystrixutils.responsiveresource.ResponseResourceService.execute(ResponseResourceService.java:194)

at com.hystrixutils.responsiveresource.ResponseResourceService$1.call(ResponseResourceService.java:132)

at com.hystrixutils.responsiveresource.ResponseResourceService$1.call(ResponseResourceService.java:128)

at com.hystrixutils.responsiveresource.ResponseResourceService$2.run(ResponseResourceService.java:175)

at com.hystrixutils.responsiveresource.ResponseResourceService$2.run(ResponseResourceService.java:172)

at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)

at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)

at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)

at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

at rx.Observable.unsafeSubscribe(Observable.java:10151)

at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)

at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)

at rx.Observable.unsafeSubscribe(Observable.java:10151)

at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)

at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)

at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

at rx.Observable.unsafeSubscribe(Observable.java:10151)

at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)

at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:56)

at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:47)

at com.hystrixutils.MDCCompatibleConcurrencyStrategy$1.call(MDCCompatibleConcurrencyStrategy.java:44)

at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:69)

at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.reflect.InvocationTargetException: null

at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.hystrixutils.responsiveresource.ResponseResourceService.execute(ResponseResourceService.java:192)

... 34 common frames omitted

Caused by: java.lang.NullPointerException: null

at sun.reflect.GeneratedConstructorAccessor207.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)

at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)

at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)

at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)

at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)

at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)

at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:650)

at com.marketdata.delayed.webservice.service.MarketDataService.getQuotes(MarketDataService.java:175)

... 38 common frames omitted

Caused by: java.lang.NullPointerException: null

at com.reuters.rfa.internal.rwf.RwfEncoder.initialize(Unknown Source)

at com.marketdata.delayed.webservice.common.utils.reuters.ReutersClientImpl.encodeLoginReqMsg(ReutersClientImpl.java:197)

at com.marketdata.delayed.webservice.common.utils.reuters.ReutersClientImpl.sendLoginRequest(ReutersClientImpl.java:166)

at com.marketdata.delayed.webservice.common.utils.reuters.ReutersClientImpl.loginIfNeeded(ReutersClientImpl.java:132)

at com.marketdata.delayed.webservice.service.ReutersConnectionService.execute(ReutersConnectionService.java:50)

at com.marketdata.delayed.webservice.service.MarketDataService.lambda$getQuotes$0(MarketDataService.java:180)

at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)

at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)

at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)

at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)

at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)

at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)

at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

icon clock
10 |1500

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

Upvotes
11.5k 16 7 10

Hello @carl_miller

Is there any change when you re-deploy the application? (Java version, OS, Server side?).

If you can, I suggest you test with the RFA Java 8.2.0 L2 which is the latest version (you can download it here)

icon clock
10 |1500

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

No changes that we are aware of when re deploying. Still looking at this angle.

Any possibility of some weird race condition if this line is being threaded? ommEncoder.initialize(OMMTypes.MSG, 5000);

Click below to post an Idea Post Idea