消费者报错信息:
Invocation of init method failed; nested exception is com.alibaba.dubbo.rpc.RpcException:
Failed to invoke the method 方法名 in the service service类名.
Tried 1 times of the providers [测试服务器ip地址:20880] (1/1) from the registry 测试服务器ip地址:2181 on the consumer
172.19.145.65 using the dubbo version 2.8.3. Last error is: Invoke remote method timeout.
method: 方法名, provider: dubbo://测试服务器ip地址:20880/service类名
request: Request [id=0, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=方法名, parameterTypes=[class java.lang.String], arguments=[005], attachments={path=service类名, appId=项目名, interface=service类名, version=0.0.0, timeout=50000}]], channel: /测试服务器ip地址:48006 -> /测试服务器ip地址:20880
消费者报错信息:
[10:37:00|WARN |(com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation)]=[ [DUBBO] Decode argument[1] failed: java.lang.String cannot be cast to java.util.SortedMap, dubbo version: 2.8.3, current host: 127.0.0.1]
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.SortedMap
at de.javakaffee.kryoserializers.SynchronizedCollectionsSerializer$SynchronizedCollection$7.create(SynchronizedCollectionsSerializer.java:148)
at de.javakaffee.kryoserializers.SynchronizedCollectionsSerializer.read(SynchronizedCollectionsSerializer.java:71)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:761)
at com.alibaba.dubbo.common.serialize.support.kryo.KryoObjectInput.readObject(KryoObjectInput.java:125)
at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:117)
at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:74)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:140)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:134)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:95)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46)
at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalDecoder.messageReceived(NettyCodecAdapter.java:134)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
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)
进行jar包冲突排查解决后,问题消失,应该是jar包冲突了。
idea冲突解决办法:maven窗口中有show dependencies选项,点击后会打开项目的jar包依赖关系图,右键Actual size显示正常大小,有冲突的jar包会被红色虚线标注出来,点击需要排除的jar,右键Exclude或者shift+delete排除jar包