[ https://issues.apache.org/jira/browse/CAMEL-14098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Feng updated CAMEL-14098: ------------------------------- Fix Version/s: 3.0.0.RC3 > netty throws exception if post does not have an empty body > ---------------------------------------------------------- > > Key: CAMEL-14098 > URL: https://issues.apache.org/jira/browse/CAMEL-14098 > Project: Camel > Issue Type: Bug > Components: camel-netty-http > Affects Versions: 3.0.0.RC2 > Environment: Java 1.8 running on a Mac > Reporter: Mark Grand > Assignee: Zheng Feng > Priority: Major > Fix For: 3.0.0.RC3 > > Attachments: UiaMain.java, UiaRouteConfig.java, pom.xml > > > I have a very simple route: > {code:java} > class UiaRouteConfig extends RouteBuilder { > @Override > public void configure() { > from("netty-http:http://0.0.0.0:8080/authorization") > .to("mock:foo"); > } > } > {code} > If I send a post with no data like this, it works as expected: > {code:java} > curl -v -X POST http://localhost:8080/authorization > {code} > However, if I send even one byte of data like this > {code:java} > curl -v -X POST http://localhost:8080/authorization -d x > {code} > netty throws this exception: > {code} > 13:10:14.370 [Camel (camel-1) thread #5 - NettyEventExecutorGroup] DEBUG > o.a.c.c.netty.http.NettyHttpConsumer - Closing channel as an exception was > thrown from Netty13:10:14.370 [Camel (camel-1) thread #5 - > NettyEventExecutorGroup] DEBUG o.a.c.c.netty.http.NettyHttpConsumer - Closing > channel as an exception was thrown from > Nettyio.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1 at > io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:74) > at > io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:138) > at > io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:100) > at > io.netty.handler.codec.http.HttpObjectAggregator$AggregatedFullHttpMessage.release(HttpObjectAggregator.java:379) > at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) at > io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:112) > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) > at > io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:56) > at > io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:365) > at > io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) > at > io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) > at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) > at java.base/java.lang.Thread.run(Thread.java:834){code} > If it helps, I have uploaded the two classes in this example, along with a > maven pom file to build an executable .jar. -- This message was sent by Atlassian Jira (v8.3.4#803005)