Hi,
I have extended DemuxingProtocolCodecFactory with multiple codecs attached,
When I send a message that is not parsed by any of the codecs I receive the
ProtocolDecoderException exception from my handler:
public void exceptionCaught(IoSession session, Throwable cause) throws
Exception
in my IoHandlerAdapter
but here ProtocolDecoderException.getHexDump is always empty.
The cause is here at the doDecode method of DemuxingProtocolCodecFactory
.CumulativeProtocolDecoder class
if (undecodables == decoders.length) {
// Throw an exception if all decoders cannot decode
data.
String dump = in.getHexDump();
in.position(in.limit()); // Skip data
throw new ProtocolDecoderException(
"No appropriate message decoder: " + dump);
}
It should be changed to something like
if (undecodables == decoders.length) {
// Throw an exception if all decoders cannot decode
data.
String dump = in.getHexDump();
in.position(in.limit()); // Skip data
ProtocolDecoderException e = new
ProtocolDecoderException(
"No appropriate message decoder: " + dump);
e.setHexDump(dump); <-------------- I believe, this is
missed here
throw e;
}
I have checked the source of 1.1.5 and the issue was still there.
Thank you for all the efforts in the Mina framework.
Hakan.
--
View this message in context:
http://www.nabble.com/ProtocolDecoderException.getHexDump-always-returns-%27empty%27-tp14731177s16868p14731177.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.