question

Upvote
Accepted
93 3 1 7

IllegalArgumentException thrown byElementEntry.encodeInit

I have an issue encoding an element list.

I have a test whereby I have a message buffer 1024 bytes, the message contains an eleement list, containing a string element followed by an element containing a vector. The test is to encode refresh messages increasing the string element by one byte. ElementEntry.encodeInit throws an illegalArgumentException. This is because it is calling ByteBuffer.position(1025).

I expect to get a BUFFER_TOO_SMALL response after which I can encodeComplete(false) the elemententry, encodeComplete(true) the ElementList and Message and write the buffer.

Error occurs on UPA 7.4 and 8. I have enclosed the stack trace for 8

Data from breakpoint on IllegalArgumentException

params to HeapByteBuffer

this HeapByteBuffer (id=153)
arg0 1025

Eclipse Stack trace

TestFragmentationPublish [JUnit]
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner at localhost:52870
Thread [main] (Suspended (exception IllegalArgumentException))
HeapByteBuffer(Buffer).position(int) line: 236
T(BA).C(int) line: not available
K.A(EncodeIterator, ElementEntry, int) line: not available
x.encodeInit(EncodeIterator, int) line: not available
ElementListStateEncoder.encodeField(EncodeIterator, IPubField) line: 345
ElementListStateEncoder.submit(long, List<IPubField>) line: 92
AgoraElementTestPayload(ElementListPayload).getRefresh(IElementListState) line: 72
AgoraElementTestPayload(ElementListPayload).getRefresh(ICompositeState) line: 1
ElementListUpdater(CompositeUpdater<S>).getRefresh(S) line: 186
ElementListCompositeSubmitter.getRefresh(EncoderContext, ICompositeState) line: 36
JUTestSubmitter.submitRefresh(EncoderContext, IUpdaterProxy) line: 89
ElementListCompositeSubmitter(MessageSubmitter).submitRefresh(EncoderContext) line: 38
PublishStream.publish(PublishRequest) line: 276
TestFragmentationPublish.t003_testSubmitElementListRefresh() line: 128
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 601
FrameworkMethod$1.runReflectiveCall() line: 47
FrameworkMethod$1(ReflectiveCallable).run() line: 12
FrameworkMethod.invokeExplosively(Object, Object...) line: 44
InvokeMethod.evaluate() line: 17
RunBefores.evaluate() line: 26
RunAfters.evaluate() line: 27
BlockJUnit4ClassRunner(ParentRunner<T>).runLeaf(Statement, Description, RunNotifier) line: 271
BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier) line: 70
BlockJUnit4ClassRunner.runChild(Object, RunNotifier) line: 50
ParentRunner$3.run() line: 238
ParentRunner$1.schedule(Runnable) line: 63
BlockJUnit4ClassRunner(ParentRunner<T>).runChildren(RunNotifier) line: 236
ParentRunner<T>.access$000(ParentRunner, RunNotifier) line: 53
ParentRunner$2.evaluate() line: 229
RunBefores.evaluate() line: 26
RunAfters.evaluate() line: 27
BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 309
JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 50
TestExecution.run(ITestReference[]) line: 38
RemoteTestRunner.runTests(String[], String, TestExecution) line: 459
RemoteTestRunner.runTests(TestExecution) line: 675
RemoteTestRunner.run() line: 382
RemoteTestRunner.main(String[]) line: 192
Thread [ReaderThread] (Running)
C:\Program Files (x86)\Java\jdk1.7.0_06\bin\javaw.exe (5 Apr 2016 10:42:55)

elektronelektron-sdkrrtjavaeta-apielektron-transport-apiencoding
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
9.5k 10 5 7

This was UPAJ bug and it has been fixed. The fixed API is ETA(Elektron Transport API) Java version 3.0.0. UPA Java has been renamed to be ETA Java. ETA Java 3.0.0 is functionally equivalent to the UPA Java 8.0.0.L1.ETA Java 3.0.0 can be found in 2 packages

1.Elektron SDK - Java - 1.0.2: This SDK is an all encompassing package of all Elektron APIs. It includes the entire ETA Java distribution package and the Elektron Message API (EMA)

2. ETA - Java - 3.0.0 - All: The binary package that contains only the core, non-open source JAR and JNI files of ETA Java.

Both packages can be found at https://developers.thomsonreuters.com/elektron-internal/elektron-sdk-java-edition/downloads

After login , click on Elektron SDK - Java Edition .Next click Downloads.

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
45.3k 103 44 60

The question has been escalated to TRDC.

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

Your question has been created as a case 04537768 IllegalArgumentException thrown byElementEntry.encodeInit. You will get response via the email directly.

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.