You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dmytro Rud <dm...@gmail.com> on 2016/11/23 12:43:53 UTC

camel-netty4 with XmlFrameDecoder and io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1

Hello,

I am trying to implement a protocol where bundles of XML messages can be
transferred over plain TCP.  For that, I use camel-netty4 and Netty's
XmlFrameDecoder on both consumer and producer.  The consumer can handle the
request without any problems, but when the producer tries to handle the
response, the following exception occurs:

io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
at
io.netty.buffer.AbstractReferenceCountedByteBuf.retain0(AbstractReferenceCountedByteBuf.java:77)
at
io.netty.buffer.AbstractReferenceCountedByteBuf.retain(AbstractReferenceCountedByteBuf.java:62)
at
org.apache.camel.component.netty4.NettyConverter.toByteArray(NettyConverter.java:58)
....

I experienced this with Camel 2.17.3 and 2.18.0, then I saw the issue
CAMEL-10409 and tried Camel 2.19.0-SNAPSHOT and 2.18.1-SNAPSHOT (both from
20161123), but this dd not help.  Upgrading Netty from 4.1.5 to 4.1.6 did
not help as well.

Does anybody have an idea how to fix it?  A sample project is located on
https://github.com/unixoid/netty-test and also attached to this message.

Thank you and kind regards
Dmytro