Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Dubbo 接口自定义对象响应 cannot be cast to 异常 #9

Open
xcorpio opened this issue Dec 27, 2019 · 1 comment
Open

Dubbo 接口自定义对象响应 cannot be cast to 异常 #9

xcorpio opened this issue Dec 27, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@xcorpio
Copy link
Collaborator

xcorpio commented Dec 27, 2019

复现

https://github.com/asura-pro/pea-simulations/blob/master/ext-library/src/main/java/pea/example/ext/dubbo/api/GreetingService.java#L9

异常

HelloResponse 第一次正常, 后续的调用会报 pea.example.ext.dubbo.response.HelloResponse cannot be cast to pea.example.ext.dubbo.response.HelloResponse 这种异常.

这边每次执行会使用自定义的类加载器重载, 可能是 dubbo 生成的动态代理类缓存, 在后续的执行用了缓存的 HelloResponse class, 这时候引擎的该对象的 classloader 和 dubbo 内部的代理对象不一样啦

@xcorpio xcorpio added the bug Something isn't working label Dec 27, 2019
@xcorpio
Copy link
Collaborator Author

xcorpio commented Dec 27, 2019

apache/dubbo#5545

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant