question

Upvotes
Accepted
488 16 20 29

RWF Error: "Success: Container was decoded from an empty payload."

Hi,

I’ve run into an interesting problem decoding an RWF message in UPAJ (v8). The message is a MAP, and when decoding, I get a non-success return error: NO_DATA (16) with the text:

Success: Container was decoded from an empty payload. The user should not try to decode any entries

My decoder logic is:

Map map = CodecFactory.createMap();
if ((retVal = map.decode(decodeIterator)) != CodecReturnCodes.SUCCESS) 
{LOG.error(String.format("RWF Error %s (%d) encountered with DecodeMap. Error Text: %s. msgkey: %s", CodecReturnCodes.toString(retVal), retVal, CodecReturnCodes.info(retVal), msgkey), new Throwable()); return returnMap;
} 

So for some reason, retVal is being returned as an error, but the error text indicates that there was no error.

The Data Analysis tool (DAS) seems to report that this is a bad RWF message, so I’m not sure if the actual source data is bad, or something weird is happening on the decode. If the data is good, it would seem like there is a bug in DAS, and that UPA doesn’t behave ideally - would expect the return to be success and then the map.containerType() to be set to NO_DATA. If the data is faulty, then UPA reporting an error with a msg of ‘Success’ is also not ideal.

Any thoughts?

elektronelektron-sdkrrtjavaeta-apielektron-transport-apijson-payload
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
1.9k 7 10 16

CodecReturnCodes.NO_DATA (16) is still a kind of success code, because its value is greater than CodecReturnCodes.SUCCESS (0).

According to UPA Java Developer Guide (10.4 Return Code Values), "When using the Codec package, return codes greater than or equal to CodecReturnCodes.SUCCESS indicate some type of specific success code, while codes less than CodecReturnCodes.SUCCESS indicate some type of specific failure."

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
401 21 25 35

The NO_DATA return code is returned when you attempt to decode a container that has no length (normally bytes are present for the container’s header even if it is empty). In normal cases this is the result of attempting to decode the payload of an entry with a DELETE action, for example if you:

1) Decode a Map with containerType FIELD_LIST

2) Decode a MapEntry (from that Map) whose action is DELETE.

3) You attempt to decode the FieldList anyway. ß This will result in NO_DATA being returned.

A DELETE action indicates the MapEntry has no payload, so you can skip step 3 above; either way, the next step should be to decode the next MapEntry. Check if this is what you are doing when you encounter it.

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.