Trying to parse the following message (size: 227 bytes):
[48, 49, 49, 48, 114, 48, 68, 0, 14, -63, -128, 0, 49, 54, 52, 51, 55, 52, 52, 52, 48, 57, 57, 48, 52, 53, 50, 55, 50, 50, 51, 56, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 48, 51, 53, 55, 51, 57, 49, 50, 49, 57, 48, 52, 49, 55, 49, 57, 48, 48, 51, 54, 56, 48, 49, 51, 49, 50, 49, 57, 48, 52, 49, 55, 49, 57, 53, 57, 57, 57, 56, 49, 48, 48, 48, 48, 48, 48, 52, 49, 49, 51, 52, 50, 57, 49, 49, 51, 52, 50, 57, 48, 48, 52, 48, 48, 48, 48, 50, 32, 32, 48, 48, 48, 49, 48, 49, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 57, 53, 51, 48, 48, 50, 48, 49, 51, 49, 56, 53, 49, 51, 48, 57, 50, 52, 49, 52, 50, 55, 50, 49, 48, 49, 49, 48, 49, 48, 45, 48, 48, 48, 48, 48, 48, 49, 48, 48, 48, 48, 48, 54, 52, 51, 53, 53, 53, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -47, -46, -64, -53, -59, -62, -64, -48, -50, -62, 44, 32, 53, 52, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 53, 53, 52, 50, 50, 49, 54, 52, 51]
As a result, getting error: Insufficient data for NUMERIC field 49 of length 3, pos 244...
Cause - incorrectly calculated length of the field 48!
I think the error in this place: MessageFactory.java line 464 (pos += val.toString().getBytes(fpi.getCharacterEncoding()).length;). The header of field 48 contains the length in 95 bytes.In fact, we get 115 bytes.Why not extract the length of the field from header? XML config is attached.
Anonymous