io.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.util.AbstractReferenceCounted.release(AbstractReferenceCounted.java:76)
at io.netty.handler.codec.http.multipart.MixedAttribute.release(MixedAttribute.java:320)
at io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder.destroy(HttpPostMultipartRequestDecoder.java:947)
at io.netty.handler.codec.http.multipart.HttpPostRequestDecoder.destroy(HttpPostRequestDecoder.java:247)
at com.github.dreamhead.moco.extractor.FormsRequestExtractor.doExtract(FormsRequestExtractor.java:42)
at com.github.dreamhead.moco.HttpRequestExtractor.extract(HttpRequestExtractor.java:12)
at com.github.dreamhead.moco.extractor.FormRequestExtractor.doExtract(FormRequestExtractor.java:19)
at com.github.dreamhead.moco.HttpRequestExtractor.extract(HttpRequestExtractor.java:12)
at com.github.dreamhead.moco.matcher.AbstractOperatorMatcher.match(AbstractOperatorMatcher.java:32)
at com.github.dreamhead.moco.matcher.AndRequestMatcher.doMatch(AndRequestMatcher.java:14)
at com.github.dreamhead.moco.matcher.CompositeRequestMatcher.match(CompositeRequestMatcher.java:44)
at com.github.dreamhead.moco.setting.BaseSetting.match(BaseSetting.java:30)
at com.github.dreamhead.moco.internal.Responser.getResponse(Responser.java:22)
at com.github.dreamhead.moco.internal.BaseActualServer.getResponse(BaseActualServer.java:143)
at com.github.dreamhead.moco.internal.HttpHandler.doGetResponse(HttpHandler.java:41)
at com.github.dreamhead.moco.internal.HttpHandler.getHttpResponse(HttpHandler.java:36)
at com.github.dreamhead.moco.internal.HttpHandler.handleRequest(HttpHandler.java:27)
at com.github.dreamhead.moco.internal.MocoHandler.handleHttpRequest(MocoHandler.java:55)
at com.github.dreamhead.moco.internal.MocoHandler.channelRead0(MocoHandler.java:39)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
引入上面代码 然后利用postman发送下面请求![image](https://user-images.githubusercontent.com/42602026/123502292-e4094180-d67d-11eb-8371-3dcfd20597c9.png)
就会发生如下错误
报错原因如下图
为什么增加这句话 参考这个 https://github.com/netty/netty/issues/7814
高版本又把这句话给删了,
![image](https://user-images.githubusercontent.com/42602026/123502455-38f98780-d67f-11eb-8b7a-72559c18847d.png)
利用gradle引入项目中 解决方法(升级netty):
netty应用广泛注意其他依赖影响netty版本。 其实本来打算隐藏这个错误的,又担心内存泄漏所以就升级了netty,不知道会不会出现问题。 希望作者大大早日在maven上发布新版本,很期待