maven依赖冲突解决

Scroll Down

问题描述 目前使用springboot1.X版本,springcloud Dalston版本,集成xxjob注册使用项目启动没发现任何问题,可是jobhandler一直调用不成功,日志如下

2020-11-14 11:19:34.232 ERROR 16816 --- [ntLoopGroup-3-1] c.x.r.r.n.i.n.s.NettyHttpServerHandler   : >>>>>>>>>>> xxl-rpc provider netty_http server caught exception

java.lang.NoSuchMethodError: io.netty.buffer.ByteBufUtil.getBytes(Lio/netty/buffer/ByteBuf;)[B
	at com.xxl.rpc.remoting.net.impl.netty_http.server.NettyHttpServerHandler.channelRead0(NettyHttpServerHandler.java:42)
	at com.xxl.rpc.remoting.net.impl.netty_http.server.NettyHttpServerHandler.channelRead0(NettyHttpServerHandler.java:26)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:147)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
	at java.lang.Thread.run(Thread.java:748)

日志显示找不到ByteBufUtil的方法,解决步骤

  1. 百度netty说maven冲突
  2. 查询冲突依赖 冲突项目依赖

xxjob-demo项目依赖

冲突项目依赖ByteBufUtil xxjob-demo项目依赖ByteBufUtil xxjob项目所有netty包都有依赖

明显版本不一致,开找 3. 从idea的右边栏maven窗口依次查找 罪魁祸首image.png

找到罪魁祸首,是springcloud的ribbon,尝试暂时取消,无法取消,springcloud自带ribbon,所以尝试升级是否能解决,因使用springboot1.5,而1.5支持的springcloud的Dalston版本、Edgware版本,便尝试修改,修改为Edgware.SR6已解决,项目暂时未发现其他冲突问题,已解决