seata-sdk2.0.0 kryo序列化模式下protocol class没有被注册成功

mzsu5hc0  于 3个月前  发布在  其他
关注(0)|答案(4)|浏览(43)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

seata-all 2.0.0
kryo序列化方式,客户端中SerializerSecurityRegistry#getProtocolType

file.exists() 这里返回false

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

java.lang.IllegalArgumentException: Class is not registered: io.seata.core.protocol.RegisterRMRequest
Note: To register this class use: kryo.register(io.seata.core.protocol.RegisterRMRequest.class);
at com.esotericsoftware.kryo.Kryo.getRegistration(Kryo.java:579) ~[kryo-5.4.0.jar:na]
at com.esotericsoftware.kryo.util.DefaultClassResolver.writeClass(DefaultClassResolver.java:112) ~[kryo-5.4.0.jar:na]
at com.esotericsoftware.kryo.Kryo.writeClass(Kryo.java:613) ~[kryo-5.4.0.jar:na]
at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:708) ~[kryo-5.4.0.jar:na]
at io.seata.serializer.kryo.KryoInnerSerializer.serialize(KryoInnerSerializer.java:44) ~[seata-all-2.0.0.jar:2.0.0]
at io.seata.serializer.kryo.KryoSerializer.serialize(KryoSerializer.java:35) ~[seata-all-2.0.0.jar:2.0.0]
at io.seata.core.rpc.netty.v1.ProtocolV1Encoder.encode(ProtocolV1Encoder.java:96) ~[seata-all-2.0.0.jar:2.0.0]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1071) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:164) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.50.Final.jar:4.1.50.Final]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_382]

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Minimal yet complete reproducer code (or URL to code):

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version(e.g. java -version ):
  • Seata client/server version:
  • Database version:
  • OS(e.g. uname -a ):
  • Others:
gwbalxhn

gwbalxhn1#

What is expected to resolved this bug

alen0pnh

alen0pnh2#

I have repeated the question. The main cause of the problem is the jar path taken after the release instead of the file path.

du7egjpx

du7egjpx3#

我尝试读取jar中的加载好了,但是测试的时候本地启动,tc读取的是target下classes,测试用例读取的jar,这样class注册的id顺序不一致,依然报错,我的想法还是改成手动注册class,这样顺序才能保证一致

相关问题