You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/10 10:02:10 UTC

[GitHub] [dubbo] fangxueshun opened a new issue, #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误

fangxueshun opened a new issue, #10911:
URL: https://github.com/apache/dubbo/issues/10911

   
   ### Environment
   
   * Dubbo version: 2.7.15
   * Operating System version: mac,linux
   * Java version: 1.8.0_29
   
   ### Steps to reproduce this issue
   
   1. 客户端发起泛化调用,使用map包装参数,给出
   2. 消费端反序列化时,会提示强转失败
   3. ClassCastException: xxx cannot be cast to xxx
   
   这个问题在版本2.7.0中时不存在的,经过初步定位是因为2.7.15中更新了org.apache.dubbo.common.utils.PojoUtils#realize(java.lang.Object[], java.lang.Class<?>[], java.lang.reflect.Type[])方法的实现导致。
   
   问题复现
   `    public static void main(String[] args) {
           Object[] objects = new Object[1];
           Map<String,Object> map = new HashMap<>();
           map.put("name", "名称");
           map.put("class", TestDemo.class.getName());
           objects[0] = map;
   
           Object[] realize = PojoUtils.realize(objects, new Class[] {TestDemo.class},
                   new Class[] {TestDemo.class});
           System.out.println(realize[0].getClass().getName());
       }`
   
   2.7.15输出:java.util.HashMap
   2.7.0输出:xxx.TestDemo
   
   相关代码
   2.7.15中的实现
   ![image](https://user-images.githubusercontent.com/10718674/201060879-d4196275-ea41-4618-aedf-a2e0d29a4bb3.png)
   
   2.7.0的实现
   ![image](https://user-images.githubusercontent.com/10718674/201060949-90a061a6-48b8-404f-8a0a-3a2ffd5e4668.png)
   
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10911:
URL: https://github.com/apache/dubbo/issues/10911#issuecomment-1311138940

   > 2.7.15输出:java.util.HashMap
   2.7.0输出:xxx.TestDemo
   
   I tried the example you give above, the results are both `java.util.HashMap`


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] aamingaa commented on issue #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误

Posted by "aamingaa (via GitHub)" <gi...@apache.org>.
aamingaa commented on issue #10911:
URL: https://github.com/apache/dubbo/issues/10911#issuecomment-1439856815

   这个问题在3.1已经修复了呢,可以升级到3.1试试


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] fangxueshun commented on issue #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误

Posted by GitBox <gi...@apache.org>.
fangxueshun commented on issue #10911:
URL: https://github.com/apache/dubbo/issues/10911#issuecomment-1330262916

   我这边可以稳定复现的,你那边的如何测试的可以说明下么
   ![image](https://user-images.githubusercontent.com/10718674/204477811-3c241579-e7eb-4b43-9ff6-c8e93382d96a.png)
   ![image](https://user-images.githubusercontent.com/10718674/204478004-b9d91d25-065d-4d0f-a96f-57a3d0952af5.png)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] fangxueshun closed issue #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误

Posted by "fangxueshun (via GitHub)" <gi...@apache.org>.
fangxueshun closed issue #10911: 泛化调用时,传入map对象,在消费端反序列化类型错误
URL: https://github.com/apache/dubbo/issues/10911


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org