codingapi / codingapi/tx-lcn

在跨服务调用的时候,经常会偶发性报这个错。

オープン
#570 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
4.2k
フォーク
1.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.

### 1. Bug Description
在跨服务调用的时候,经常会偶发性报这个错。
2021-09-15 12:45:35 ERROR FEBS-Server-Mall nioEventLoopGroup-6-1 com.codingapi.txlcn.txmsg.netty.handler.NettyClientRetryHandler NettyClientRetryHandler - exception .
io.netty.handler.codec.DecoderException: com.codingapi.txlcn.common.exception.SerializerException: java.lang.ClassNotFoundException: org.hibernate.exception.SQLGrammarException
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
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.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:326)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:300)
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:1422)
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:931)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.codingapi.txlcn.common.exception.SerializerException: java.lang.ClassNotFoundException: org.hibernate.exception.SQLGrammarException
at com.codingapi.txlcn.common.util.serializer.ProtostuffSerializer.deSerialize(ProtostuffSerializer.java:99)
at com.codingapi.txlcn.common.util.serializer.SerializerContext.deSerialize(SerializerContext.java:61)
at com.codingapi.txlcn.txmsg.netty.handler.ObjectSerializerDecoder.decode(ObjectSerializerDecoder.java:41)
at com.codingapi.txlcn.txmsg.netty.handler.ObjectSerializerDecoder.decode(ObjectSerializerDecoder.java:31)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
... 21 common frames omitted
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.exception.SQLGrammarException
at io.protostuff.runtime.RuntimeEnv.loadClass(RuntimeEnv.java:258)
at io.protostuff.runtime.DefaultIdStrategy.getSchemaWrapper(DefaultIdStrategy.java:185)
at io.protostuff.runtime.DefaultIdStrategy.resolvePojoFrom(DefaultIdStrategy.java:524)
at io.protostuff.runtime.PolymorphicThrowableSchema.readObjectFrom(PolymorphicThrowableSchema.java:205)
at io.protostuff.runtime.PolymorphicThrowableSchema.readObjectFrom(PolymorphicThrowableSchema.java:199)
at io.protostuff.runtime.PolymorphicThrowableSchema.mergeFrom(PolymorphicThrowableSchema.java:129)
at io.protostuff.CodedInput.mergeObjectEncodedAsGroup(CodedInput.java:359)
at io.protostuff.CodedInput.mergeObject(CodedInput.java:321)
at io.protostuff.runtime.RuntimeUnsafeFieldFactory$15$1.mergeFrom(RuntimeUnsafeFieldFactory.java:1217)
at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:466)
at io.protostuff.runtime.PolymorphicThrowableSchema.readObjectFrom(PolymorphicThrowableSchema.java:243)
at io.protostuff.runtime.ObjectSchema.readObjectFrom(ObjectSchema.java:678)
at io.protostuff.runtime.ObjectSchema.mergeFrom(ObjectSchema.java:350)
at io.protostuff.CodedInput.mergeObjectEncodedAsGroup(CodedInput.java:359)
at io.protostuff.CodedInput.mergeObject(CodedInput.java:321)
at io.protostuff.runtime.RuntimeUnsafeFieldFactory$15$1.mergeFrom(RuntimeUnsafeFieldFactory.java:1217)
at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:466)
at io.protostuff.CodedInput.mergeObjectEncodedAsGroup(CodedInput.java:359)
at io.protostuff.CodedInput.mergeObject(CodedInput.java:321)
at io.protostuff.runtime.RuntimeUnsafeFieldFactory$13$1.mergeFrom(RuntimeUnsafeFieldFactory.java:1038)
at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:466)
at io.protostuff.IOUtil.mergeFrom(IOUtil.java:77)
at io.protostuff.ProtostuffIOUtil.mergeFrom(ProtostuffIOUtil.java:122)
at com.codingapi.txlcn.common.util.serializer.ProtostuffSerializer.deSerialize(ProtostuffSerializer.java:96)
... 25 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.hibernate.exception.SQLGrammarException
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at io.protostuff.runtime.RuntimeEnv.loadClass(RuntimeEnv.java:251)
... 48 common frames omitted

### 2. Environment:
- JDK version:1.8
- OS:
- TX-LCN version:5.0.2
- Others:

### 3. Exception Stacktrace
![image](https://user-images.githubusercontent.com/62318774/133594226-572e9d60-8e53-4b0d-8060-df2364fdaab0.png)

```
Paste your Exception Stacktrace here!
```

### 4. Tour Idea

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

com.codingapi.txlcn.common.util.serializer.ProtostuffSerializer、特に deSerialize から調査を開始し、ObjectSerializerDecoder を追って Netty のサービス間メッセージパスを確認します。デシリアライズ時にサービス間で org.hibernate.exception.SQLGrammarException をロードできない理由を調査し、報告された JDK 8 および TX-LCN 5.0.2 の環境で断続的な失敗を再現します。報告されたサービス間呼び出しがこの ClassNotFoundException で失敗しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
distributed-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。