You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "lixinwen (GitHub)" <gi...@apache.org> on 2020/03/14 13:49:34 UTC

[GitHub] [dubbo] lixinwen opened issue #5865: fastjson serializaion unable parse generic types

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.5
* Operating System version: MAC OS X
* Java version: Hotspot 1.8

### Steps to reproduce this issue

1.define method 
void add(Map<Integer, Student> map)
2.config
<dubbo:protocol name="dubbo" port="20880" serialization="fastjson" />
3.call method add.

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result
provider deserialize Map<Integer, Student> ok, map's value is Student type.

### Actual Result

Map's value is JSONObject type.

Because in DecodeableRpcInvocation#decode(Channel channel, InputStream input), 
pts = methodDescriptor.getParameterClasses(), not ParameterizedType, in this case, fastjson unable parse Map's value is  Student.

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

```
Just put your stack trace here!
```


[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] xiantang commented on issue #5865: fastjson serializaion unable parse generic types

Posted by "xiantang (GitHub)" <gi...@apache.org>.
@lixinwen 
you can try dubbo default  serialize tool gson by remove 
`serialization="fastjson" ` field in below.
`<dubbo:protocol name="dubbo" port="20880" serialization="fastjson" />`
plz reproduce the bug

[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] lixinwen commented on issue #5865: fastjson serializaion unable parse generic types

Posted by "lixinwen (GitHub)" <gi...@apache.org>.
> @lixinwen
> you can try dubbo default serialize tool gson by remove
> `serialization="fastjson" ` field in below.
> `<dubbo:protocol name="dubbo" port="20880" serialization="fastjson" />`
> plz reproduce the bug

You can try my example, link: https://github.com/lixinwen/test
Please make sure dubbo version is 2.7.5.
In addition, when the protocol is dubbo, the default serialization tool is hessian.

[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] xiantang commented on issue #5865: fastjson serializaion unable parse generic types

Posted by "xiantang (GitHub)" <gi...@apache.org>.
@lixinwen 
i can try dubbo default  serialize tool gson by remove 
`serialization="fastjson" ` field in below.
`<dubbo:protocol name="dubbo" port="20880" serialization="fastjson" />`
plz reproduce the bug

[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] xiantang commented on issue #5865: fastjson serializaion unable parse generic types

Posted by "xiantang (GitHub)" <gi...@apache.org>.
i can not reproduce your issue 
https://github.com/xiantang/dubbo-demo/blob/master/api/src/main/java/info/xiantang/api/bean/User.java#L17 
there is my code link

[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] lixinwen closed issue #5865: fastjson serializaion unable parse generic types

Posted by "lixinwen (GitHub)" <gi...@apache.org>.
[ issue closed by lixinwen ]

[ Full content available at: https://github.com/apache/dubbo/issues/5865 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org