- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of 
this repository and believe that this is not a duplicate.
- [x] 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.4.1
* Operating System version: macos, linux
* Java version: 1.8

### 背景
这个issue不是正常的使用场景下产生的啊... 我在做一个 dubbo 的[压测工具](https://github.com/asura-pro/pea) 
,  要在 JVM 不退出的情况下 重载 dubbo 的接口class.  如: 
[GreetingService](https://github.com/asura-pro/pea-simulations/blob/master/ext-library/src/main/java/pea/example/ext/dubbo/api/GreetingService.java)
```java
public interface GreetingService {
  String sayHello(String name);
  HelloResponse sayHello2(String name);
}
```

### 现象

第一次调用时 `HelloResponse` 返回正常,类加载器是: 
[pea.app.compiler.ReloadableClassLoader](https://github.com/asura-pro/pea/blob/master/app/pea/app/compiler/ReloadableClassLoader.scala)
(这个是我自定义的类加载器, 每次调用都会是新的)。

之后的调用就会报异常: 
```
[error] p.d.a.DubboAction - failure: ==========> java.lang.ClassCastException: 
pea.example.ext.dubbo.response.HelloResponse cannot be cast to 
pea.example.ext.dubbo.response.HelloResponse
        at org.apache.dubbo.common.bytecode.proxy1.sayHello2(proxy1.java)
        at 
pea.example.dubbo.GreetingSimulation.$anonfun$scn$1(GreetingSimulation.scala:23)
        at pea.dubbo.action.DubboAction.$anonfun$execute$1(DubboAction.scala:43)
        at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:658)
        at scala.util.Success.$anonfun$map$1(Try.scala:255)
        at scala.util.Success.map(Try.scala:213)
```
### 问题

这个问题大概是怎么产生的啊?为啥第一调用没事, 代理类返回的 `HelloResponse`是不是有缓存啊之类的?如果有怎么清掉?

[ Full content available at: https://github.com/apache/dubbo/issues/5545 ]
This message was relayed via gitbox.apache.org for 
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to