xiaoyuuuuuupeng commented on issue #13338:
URL: https://github.com/apache/dubbo/issues/13338#issuecomment-1813885545

   > > > 多谢关注! 直接降级dubbo的版本,我本地会报错,找不到这个类 
InstantiationAwareBeanPostProcessorAdapter。 
报错的原因是,dubbo3.1.4里面引用的是spring版本是5.2.20(这个版本的spring 
beans里面有上面这个类),我在Provider和Consumer工程里面把这个依赖排除掉了,单独引用的6.0.12(这个版本里面没有上面这个类)。实际上这个工程把spring和dubbo的版本都降下来(dubbo2),是不报错的。
 之所以要单独在Provider和Consumer里面引用spring 6.0.12,对应的spring 
boot版本是3.1.14,主要是这个版本开始支持jdk21。并且dubbo 
3.2.7开始支持jdk21。我的目的是让spring和dubbo同时支持jdk21,保证整个项目能升级到jdk21。
   > > > > use dubbo version 3.1.7, will be ok 
![WechatIMG24553](https://user-images.githubusercontent.com/30964063/283025557-342fd647-c29e-443d-8350-e7ab98f1f63b.png)
   > > 
   > > 
   > > 可以在不改动版本的情况下 使用tri协议 tri协议 支持grpc的原生调用 后续应该是不支持纯grpc协议的 
dubbo.protocal.name=grpc => dubbo.protocal.name=tri 
并使用Dubbo3TripleGenerator生成proto代码
   > 
   > 我尝试将协议改成tri,同时proto插件改成Dubbo3TripleGenerator,仍然报相同的错误: 
java.lang.RuntimeException: fieldNum should in (1,2,3) at 
org.apache.dubbo.rpc.protocol.tri.TripleCustomerProtocolWapper$TripleRequestWrapper.parseFrom(TripleCustomerProtocolWapper.java:269)
 at 
org.apache.dubbo.rpc.protocol.tri.call.ReflectionAbstractServerCall.trySetMethodDescriptor(ReflectionAbstractServerCall.java:175)
 at 
org.apache.dubbo.rpc.protocol.tri.call.ReflectionAbstractServerCall.parseSingleMessage(ReflectionAbstractServerCall.java:159)
 at 
org.apache.dubbo.rpc.protocol.tri.call.AbstractServerCall.onMessage(AbstractServerCall.java:214)
 at 
org.apache.dubbo.rpc.protocol.tri.stream.TripleServerStream$ServerDecoderListener.onRawMessage(TripleServerStream.java:475)
 at 
org.apache.dubbo.rpc.protocol.tri.frame.TriDecoder.processBody(TriDecoder.java:139)
 at 
org.apache.dubbo.rpc.protocol.tri.frame.TriDecoder.deliver(TriDecoder.java:86) 
at org.apache.dubbo.rpc.protocol.tri.fr
 ame.TriDecoder.deframe(TriDecoder.java:56) at 
org.apache.dubbo.rpc.protocol.tri.stream.TripleServerStream$ServerTransportObserver.doOnData(TripleServerStream.java:441)
 at 
org.apache.dubbo.rpc.protocol.tri.stream.TripleServerStream$ServerTransportObserver.lambda$onData$2(TripleServerStream.java:434)
 at 
org.apache.dubbo.common.threadpool.serial.SerializingExecutor.run(SerializingExecutor.java:102)
 at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
 at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
 at 
org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
 at java.base/java.lang.Thread.run(Thread.java:1583)
   
   [DubboTestJdk21 
2.zip](https://github.com/apache/dubbo/files/13373250/DubboTestJdk21.2.zip)
   需要改动的地方:
   1、proto增加option java_multiple_files = true;
   2、proto-plugin改为trip的
   ```xml
     <protocPlugins>
                           <protocPlugin>
                               <id>dubbo-grpc</id>
                               <groupId>org.apache.dubbo</groupId>
                               <artifactId>dubbo-compiler</artifactId>
                               <version>3.2.7</version>
                               
<mainClass>org.apache.dubbo.gen.tri.Dubbo3TripleGenerator</mainClass>
                           </protocPlugin>
                       </protocPlugins>
   ```
   3、修改Server和client代码 
   我已经改好了 你可以下载看下 已经测过OK了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to